Rule: css
extension
Generates a Css.rule
Css.rule
given a single CSS rule as string. The %css
extension is useful with combination with the Array API, to compose and re-use rules.
Example
let rule: Css.rule = %css("display: block")
let rule: Css.rule = %css("display: block")
Features
- Only single properties are allowed. Declaratiosn aren't. Declarations can contain selectors, rules only a pair of property/value. If you need a selector or more than one rule, use
%cx
%cx
instead. - The semi-colon in the last position is optional.
display: block;
display: block;
anddisplay: block
display: block
are the same. - Curly braces aren't allowed.
{ display: block }
{ display: block }
isn't valid.