12 October 2011

Do you sass that hoopy Ford Prefect? Now there's a frood who really knows where his towel is. - The Hitchiker's Guide to the Galaxy

The following three SASS snippets all compile to the same effective CSS (effective, not identical):

#left-col, #right-col { height: 900px; }
$col-width: 900px;
#left-col {
height: $col-width;
...
}
#right-col {
height: $col-width;
...
}
.col {
height: 900px;
}
#left-col {
@extend .col
...
}
#right-col {
@extend .col
...
}

Which form do you use? If my SASS file is very small, I prefer the CSS-style option 1. In practice, I end up using option 3 the most, since I tend to have large chunks of CSS code that I can abstract into a class.


I have yet to use SASS mixins.


Thank you SVN for this inspiring article: Taking Control of the Cascade. //

blog comments powered by Disqus Back

Ustreet


Peter Kong is a
software engineer.