Tuesday, January 21, 2014

Why Sass?

Dan Cederholm:

CSS is anything but DRY. At times, it drips with repeated rules, declarations, and values. We’re constantly writing the same snippets of code for colors, fonts, and frequently-used patterns of style throughout our stylesheets. One look through a decent-sized CSS file, and a DRY software developer will weep, first with bewilderment, then frustration.

[…]

Sass is a CSS preprocessor—a layer between the stylesheets you author and the .css files you serve to the browser. Sass (short for Syntactically Awesome Stylesheets) plugs the holes in CSS as a language, allowing you to write DRY code that’ll be faster, more efficient, and easier to maintain.

It seems like ultimately this sort of thing should be built into CSS itself, though.

3 Comments RSS · Twitter

If you are interested into SASS, I recommend you to also have a look at Compass: http://compass-style.org

It is based on SASS, but brings a lot more powerful features.

SASS has completely transformed how I write CSS, if not just for the ability to use variables within stylesheets.

Ever since using it, I’ve made sure every website I’ve worked on uses it in some way.

CodeKit http://incident57.com/codekit/ is a great utility that supports SASS and can autogenerate stylesheets when changes are made.

Not Sass, but going in a similar direction: http://www.w3.org/TR/css-variables-1/

Leave a Comment