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:
parent
34152fc055
commit
35456d53cd
1 changed files with 11 additions and 12 deletions
23
README.md
23
README.md
|
@ -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,
|
||||
which is a nightmare when you decide to change it later.
|
||||
Not so for Sass!
|
||||
You can use the `!` character to set variables.
|
||||
Then, if you put `=` after your property name,
|
||||
you can set it to a variable.
|
||||
You can use the `$` character to set variables.
|
||||
Then you can use variables in properties.
|
||||
For example:
|
||||
|
||||
$note_bg= #55aaff
|
||||
$note_bg: #55aaff
|
||||
|
||||
#main
|
||||
width: 70%
|
||||
.note
|
||||
background-color = $note_bg
|
||||
background-color: $note_bg
|
||||
p
|
||||
width: 5em
|
||||
background-color = $note_bg
|
||||
background-color: $note_bg
|
||||
|
||||
becomes:
|
||||
|
||||
|
@ -232,15 +231,15 @@ becomes:
|
|||
You can even do simple arithmetic operations with variables,
|
||||
adding numbers and even colors together:
|
||||
|
||||
$main_bg= #46ar12
|
||||
$main_width= 40em
|
||||
$main_bg: #46ar12
|
||||
$main_width: 40em
|
||||
|
||||
#main
|
||||
background-color = $main_bg
|
||||
width = $main_width
|
||||
background-color: $main_bg
|
||||
width: $main_width
|
||||
.sidebar
|
||||
background-color = $main_bg + #333333
|
||||
width = $main_width - 25em
|
||||
background-color: $main_bg + #333333
|
||||
width: $main_width - 25em
|
||||
|
||||
becomes:
|
||||
|
||||
|
|
Loading…
Reference in a new issue