Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

A very small javascript library that allows you to create browser specific CSS to be merged into your normal classes. No more hacks or mischievous code in your CSS code.

Notifications You must be signed in to change notification settings

customink/css_browser_selector

 
 

Repository files navigation

CSS Browser Selector

CSS Browser Selector is a very small javascript with just one line which empower CSS selectors. It gives you the ability to write specific CSS code for each operating system and each browser.

More info: http://rafael.adm.br/css_browser_selector

Example

<style type="text/css">
  .ie .example {
    background-color: yellow
  }
  .ie7 .example {
    background-color: orange
  }
  .gecko .example {
    background-color: gray
  }
  .win.gecko .example {
    background-color: red
  }
  .linux.gecko .example {
    background-color: pink
  }
  .opera .example {
    background-color: green
  }
  .konqueror .example {
    background-color: blue
  }
  .webkit .example {
    background-color: black
  }
  .chrome .example {
    background-color: cyan
  }
  .example {
    width: 100px;
    height: 100px;
  }
</style>

Running Tests

First, install NPM.

Then, install the NPM dependencies:

npm install

Last, execute the test runner:

vows test/*

Then tests run against the minified code to ensure that the minification process hasn't broken anything and to ensure that code is re-run through the minifier.

Running UglifyJS

Assuming you have followed the previous directions for install NPM and this project's dependencies:

./node_modules/uglify-js/bin/uglifyjs css_browser_selector.js > css_browser_selector.min.js

License

http://creativecommons.org/licenses/by/2.5/

Original Author

Rafael Lima

Blog: http://rafael.adm.br

Podcast: http://rafael.adm.br/voltandopracasa

Github: http://github.com/rafaelp

Twitter: http://twitter.com/rafaelp

Fork Authors

CustomInk, LLC

Did you like?

Recommend me at Working With Rails

Original Contributors

http://rafael.adm.br/css_browser_selector#contributors

About

A very small javascript library that allows you to create browser specific CSS to be merged into your normal classes. No more hacks or mischievous code in your CSS code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CoffeeScript 95.3%
  • JavaScript 4.7%