Home - compass - GitHub
Compass is a CSS framework that allows you to define and maintain complex CSS in a succinct manner. There is a DSL which looks similar to CSS, but allows for some functional relationships to be defined. One example in the screencast essentially allows the programmer to define that one class has a border that is half the size of another CSS class. And the size of the original is defined with passing in a size as a parameter to the first class. So a single change will change all related items when the CSS is next compiled.
The second thing that stood out to me was the ability to use compass as a "glue" layer between your CSS and your html markup. In the example screen cast, the author used the ID tags on the divs and spans in the html and the appropriate CSS classes and defined those connections in the SAS DSL. The beauty of this approach is removing all references to CSS in your generated html so there is only one place to maintain changes without having to go through all the html code and do a find/replace.
Functionally, as soon as changes are made to the associated SAS file (the compass DSL), when you are running the compass compiler, it will automatically regenerate the appropriate CSS.
SAS also allows for code sharing via imports. So, it is easy to centralize CSS in such a way that it can easily be reused between various CSS files across your application.
I was skeptical about the usefulness of a CSS framework, but after watching the screencast, it makes a lot of sense as to why it could be very useful. Like anything, if CSS is grown organically as often happens in larger projects, it can grow into a hairy mess over time. I especially liked the idea of keeping the "glue" between your html and your CSS in a separate file. But, it would seem that as an application's number of screens and IDs multiplies the CSS files would become voluminous unless the developer was very careful to reuse div and span ID's. And that can be problematic as well.
Regardless, I think compass is worth looking at. I expect as our websites become increasingly dependant on complex CSS layouts, programmers and designers will start to rely more and more on tools like compass to generate their CSS.
Compass is a CSS framework that allows you to define and maintain complex CSS in a succinct manner. There is a DSL which looks similar to CSS, but allows for some functional relationships to be defined. One example in the screencast essentially allows the programmer to define that one class has a border that is half the size of another CSS class. And the size of the original is defined with passing in a size as a parameter to the first class. So a single change will change all related items when the CSS is next compiled.The second thing that stood out to me was the ability to use compass as a "glue" layer between your CSS and your html markup. In the example screen cast, the author used the ID tags on the divs and spans in the html and the appropriate CSS classes and defined those connections in the SAS DSL. The beauty of this approach is removing all references to CSS in your generated html so there is only one place to maintain changes without having to go through all the html code and do a find/replace.
Functionally, as soon as changes are made to the associated SAS file (the compass DSL), when you are running the compass compiler, it will automatically regenerate the appropriate CSS.
SAS also allows for code sharing via imports. So, it is easy to centralize CSS in such a way that it can easily be reused between various CSS files across your application.
I was skeptical about the usefulness of a CSS framework, but after watching the screencast, it makes a lot of sense as to why it could be very useful. Like anything, if CSS is grown organically as often happens in larger projects, it can grow into a hairy mess over time. I especially liked the idea of keeping the "glue" between your html and your CSS in a separate file. But, it would seem that as an application's number of screens and IDs multiplies the CSS files would become voluminous unless the developer was very careful to reuse div and span ID's. And that can be problematic as well.
Regardless, I think compass is worth looking at. I expect as our websites become increasingly dependant on complex CSS layouts, programmers and designers will start to rely more and more on tools like compass to generate their CSS.







