![]() |
|
|---|---|
| Developer(s) | Nathan Weizenbaum, Chris Eppstein, Hampton Catlin |
| Stable release | 2.2.0 / 2009-07-06 |
| Operating system | Cross-platform |
| Type | Template Engine |
| License | MIT License |
| Website | http://sass-lang.com/ |
Sass (Syntactically Awesome Stylesheets) is a module that is included in Haml. It is described as a meta-language on top of CSS, and is meant to abstract CSS code and create simpler stylesheet files.
Nested Rules
One of the key features of Sass is its nested rules, which make complicated nested selectors easy to read and write.
#header
:background #FFFFFF
.error
:color #FF0000
a
:text-decoration none
&:hover
:text-decoration underline
Would compile to:
#header {
background: #FFFFFF;
}
#header .error {
color: #FF0000;
}
#header a {
text-decoration: none
}
#header a:hover {
text-decoration: underline
}
CSS variables
Sass adds constants and mixins to css. This makes it easy to keep and maintain consistent values through out a large set of styles. Constants allow you to set one value and use it through out the styles while mixins expand that to a block of style attributes.
!link_color = #00F a :color = !link_color
Would compile to
a {
color: #00F
}
External links
|
|||||||||||
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)





