1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
---
layout: default
permalink: docs/atrules.html
---
# Other @-rules
Stylus have a basic support for braceless syntax for most of the CSS @-rules, like `@viewport`, `@page`, `@host`, `@supports` and others:
@viewport
color: #00f
@supports (display: flex)
div
display: flex
@page :blank
@top-center
content: none
Would compile to
@viewport {
color: #00f;
}
@supports (display: flex) {
div {
display: flex;
}
}
@page :blank {
@top-center {
content: none;
}
}
## Unknown at-rules
Stylus supports any yet unknown @-rules, so it is future-friendly, as any new at-rules in CSS could be written in indentation-based syntax of Stylus and would be rendered perfectly:
@foo
@bar
width: 10px
.baz
height: 10px
Would be compiled to
@foo {
@bar {
width: 10px;
.baz {
height: 10px;
}
}
}
|