xwmx / css_parser Goto Github PK
View Code? Open in Web Editor NEWThis project forked from erithmetic/css_parser
Fork of Ruby css_parser 0.9.0
License: Other
This project forked from erithmetic/css_parser
Fork of Ruby css_parser 0.9.0
License: Other
=== Ruby CSS Parser Load, parse and cascade CSS rule sets in Ruby. ==== Setup Install the gem from RubyGems. gem install css_parser Done. ==== 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 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 # add a block of CSS css = <<-EOT body { margin: 0 1em; } EOT parser.add_block!(css) # output all CSS rules in a single stylesheet parser.to_s => #content { font-size: 13px; line-height: 1.2; } body { margin: 0 1em; } ==== Testing You can run the suite of unit tests using <tt>rake test</tt>. The download/import tests require that WEBrick is installed. The tests set up a temporary server on port 12000 and pull down files from the <tt>test/fixtures/</tt> directory. ==== Credits and code By Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007-08. Project homepage: http://code.google.com/p/ruby-css-parser/ Made on Vancouver Island.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.