Programmability

Stylus provides a relatively minimal but efficient programming language in addition to the CSS syntax. Using this programming language, you can make CSS generation dynamic and more flexible.

Note

The Stylus programming language is limited in many ways, and some implementation may still be buggy due its young age.

Variables

Although the data type is not strongly defined in Stylus, variables can be broadly classified as literals, lists, and tuples.

Stylus variable identifiers can start with any alphabetical character: $, -, or _ and contain alphanumeric characters along with the aforementioned characters.

The following are some examples of variables in Stylus:

$font-weight = bold num = 100 vendors = moz webkit ms -height = (num/5)px _width ...

Get Express Web Application Development now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.