mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] Expand the operations reference a little.
This commit is contained in:
parent
635be4cebd
commit
01fce5dd9f
1 changed files with 24 additions and 6 deletions
|
@ -725,23 +725,30 @@ and equality operators
|
|||
(`==`, `!=`)
|
||||
are supported for all types.
|
||||
|
||||
Most arithmetic operations are supported for color values,
|
||||
where they work piecewise:
|
||||
All arithmetic operations are supported for color values,
|
||||
where they work piecewise.
|
||||
This means that the operation is performed
|
||||
on the red, green, and blue components in turn.
|
||||
For example:
|
||||
|
||||
p
|
||||
color = #010203 + #040506
|
||||
|
||||
is compiled to:
|
||||
computes `01 + 04 = 05`, `02 + 05 = 07`, and `03 + 06 = 09`,
|
||||
and is compiled to:
|
||||
|
||||
p {
|
||||
color: #050709; }
|
||||
|
||||
Some arithmetic operations even work between numbers and colors:
|
||||
Arithmetic operations even work between numbers and colors,
|
||||
also piecewise.
|
||||
For example:
|
||||
|
||||
p
|
||||
color = #010203 * 2
|
||||
|
||||
is compiled to:
|
||||
computes `01 * 2 = 02`, `02 * 2 = 04`, and `03 * 2 = 06`,
|
||||
and is compiled to:
|
||||
|
||||
p {
|
||||
color: #020406; }
|
||||
|
@ -756,11 +763,22 @@ is compiled to:
|
|||
p {
|
||||
cursor: e-resize; }
|
||||
|
||||
By default, if two values are placed next to one another,
|
||||
they are concatenated with a space:
|
||||
|
||||
p
|
||||
margin = 3px + 4px "auto"
|
||||
|
||||
is compiled to:
|
||||
|
||||
p {
|
||||
margin: 7px auto; }
|
||||
|
||||
Within a string of text, #{} style interpolation can be used to
|
||||
place dynamic values within the string:
|
||||
|
||||
p
|
||||
border = "#{5px + 10pt} solid #ccc"
|
||||
border = "#{5px + 10px} solid #ccc"
|
||||
|
||||
Finally, SassScript supports `and`, `or`, and `not` operators
|
||||
for boolean values.
|
||||
|
|
Loading…
Add table
Reference in a new issue