1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Sass] Update README for new syntax.

This commit is contained in:
Nathan Weizenbaum 2010-03-29 23:14:17 -07:00
parent 34152fc055
commit 35456d53cd

View file

@ -204,20 +204,19 @@ What if have a color or a width you re-use all the time?
In CSS, you just have to re-type it each time, In CSS, you just have to re-type it each time,
which is a nightmare when you decide to change it later. which is a nightmare when you decide to change it later.
Not so for Sass! Not so for Sass!
You can use the `!` character to set variables. You can use the `$` character to set variables.
Then, if you put `=` after your property name, Then you can use variables in properties.
you can set it to a variable.
For example: For example:
$note_bg= #55aaff $note_bg: #55aaff
#main #main
width: 70% width: 70%
.note .note
background-color = $note_bg background-color: $note_bg
p p
width: 5em width: 5em
background-color = $note_bg background-color: $note_bg
becomes: becomes:
@ -232,15 +231,15 @@ becomes:
You can even do simple arithmetic operations with variables, You can even do simple arithmetic operations with variables,
adding numbers and even colors together: adding numbers and even colors together:
$main_bg= #46ar12 $main_bg: #46ar12
$main_width= 40em $main_width: 40em
#main #main
background-color = $main_bg background-color: $main_bg
width = $main_width width: $main_width
.sidebar .sidebar
background-color = $main_bg + #333333 background-color: $main_bg + #333333
width = $main_width - 25em width: $main_width - 25em
becomes: becomes: