Thursday, November 29th, 2007p>Marat Denenberg has continued the trend of CSS frameworks by taking Mootools and creating CSS.js.
The library sits on top of CSS itself and gives you:
- Programmatic CSS
- Browser Compatibility
- Custom CSS Properties
Browser compatibility is sort of self-obvious. Before, you used to have a style sheet for each browser to allow for their quirks and weird CSS implementation. Now you can generate CSS that is browser specific using JS. The class is built to allow you to extend it for any browser and any property. You can specify a property to be limited, in which case it will only generate it for the browser you specify.
Ever wanted to invet your own CSS property? Now you can. See the examples for what I mean.
There are a lot of great examples, such as having IE grok opacity:
- 'trident_opacity': function(value, property)
- return ['filter', 'alpha(opacity=' + (value * 100) + ')'];
or allowing you to use border-radius and have it setup for the right browser:
- limited: ['border-radius']
- 'gecko_border-radius': function(value, property)
- return ['-moz-' + property, value];
- 'webkit_border-radius': function(value, property)
- return ['-webkit-' + property, value];
Posted by Dion Almaer at 7:09 am