Stylus
Stylus is a CSS preprocessor that StartupJS uses by default. It drops the braces, colons, and semicolons of regular CSS and uses indentation instead.
Selector syntax
Stylus
CSS equivalent
Parent selector
Use & to reference the parent selector, just like in SCSS:
This compiles to .button.active { background-color: blue; }.
Variables
Define variables and reuse them in your styles:
You can also reference a property that was already set in the same block using @:
Here, @margin refers to the margin value defined above it, so padding becomes 16px.
Mixins
StartupJS includes built-in mixins. For example, font() sets both font-size and line-height in one call:
See the Tricks with styles chapter for a full list of available mixins.