OOCSS: Object Oriented CSS
[UPDATE] September 5, 2009: New version has been released - OOCSS 2.0
-Parsing and Storing logic have been seperated out into two seperate classes
-Better caching/parsing procedure
Object Oriented CSS is a new way to write CSS files to speed up development by using parent relations and variable storage.It takes what would normally be a painfully large, unintuitive style sheet, and turns it into less code for better maintenance. All parsed scripts are cached server side.
OOCSS can parse both single and multiple definition variables. Single definition variables must follow the following pattern:
$var = prop:value;You can think of multiple definitions as an array. The array must be be enclosed in brackets trailed by a semi-colon, with each definition seperated by a comma. Ex:
$multi_var = { prop1:value1, prop2:value2, prop3:value3 }
When using a variable, they must be followed by a semi-colon, or they will not be replaced
with their values.
The file is parsed like a DOM Tree, where inner elements are considered children of the wrapped element. If you set the OOCSS_DEBUG_MODE defined variable to true, you can get a better picture of what variables are being stored, and how the tree looks.
To prevent long loads, parsed files are cached into a seperate directory. The files are stored using a combination of both oocss.php and your oocss last change times, so you can be assured that any changes made will be automatically parsed.
Take a look at the example script provided for a better understanding of how this works. Also, if you found a bug or have any questions, shoot me a mail.
Download
Latest: oocss-2.0.zipReleased: September 5, 2009
-Better caching/parsing procedure
RSS