mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] Some examples for the @warn directive.
This commit is contained in:
parent
91480eab1c
commit
dcaa55fd85
1 changed files with 27 additions and 0 deletions
|
@ -924,6 +924,33 @@ between `@warn` and `@debug`:
|
||||||
so that the user being warned can see where they are calling from
|
so that the user being warned can see where they are calling from
|
||||||
their code.
|
their code.
|
||||||
|
|
||||||
|
Usage Example:
|
||||||
|
|
||||||
|
@mixin adjust-location($x, $y) {
|
||||||
|
@if unitless($x) {
|
||||||
|
@warn "Assuming #{$x} to be in pixels";
|
||||||
|
$x: 1px * $x;
|
||||||
|
}
|
||||||
|
@if unitless($y) {
|
||||||
|
@warn "Assuming #{$y} to be in pixels";
|
||||||
|
$y: 1px * $y;
|
||||||
|
}
|
||||||
|
position: relative; left: $x; top: $y;
|
||||||
|
}
|
||||||
|
|
||||||
|
Indented Syntax Example:
|
||||||
|
|
||||||
|
=adjust-location($x, $y)
|
||||||
|
@if unitless($x)
|
||||||
|
@warn "Assuming #{$x} to be in pixels"
|
||||||
|
$x: 1px * $x
|
||||||
|
@if unitless($y)
|
||||||
|
@warn "Assuming #{$y} to be in pixels"
|
||||||
|
$y: 1px * $y
|
||||||
|
position: relative
|
||||||
|
left: $x
|
||||||
|
top: $y
|
||||||
|
|
||||||
## Control Directives
|
## Control Directives
|
||||||
|
|
||||||
SassScript supports basic control directives
|
SassScript supports basic control directives
|
||||||
|
|
Loading…
Add table
Reference in a new issue