R
Analyzed 12 months ago
Load, parse and cascade CSS rule sets in Ruby.
Install the gem from RubyGems.
gem install css_parser
An example
require 'css_parser'
include CssParser
parser = CssParser::Parser.new
parser.load_file!('http://example.com/styles/style.css')
# lookup a rule by a
... [More]
selector
parser.find('#content')
#=> 'font-size: 13px; line-height: 1.2;'
# lookup a rule by a selector and media type
parser.find('#content', [:screen, :handheld])
# iterate through selectors by media type
parser.each_selector(:screen) do |selector, declarations, specificity|
...
end
Made on Vancouver Island. [Less]
3.49K
lines of code
5
current contributors
12 months
since last commit
0
users on Open Hub