Migrating to Jess
Here are some examples of features in Less / Sass and their equivalent syntax in Jess.
Variable Declaration#
Less
Sass
Jess
Variables are declared using the @let at-rule. color must be a valid JavaScript identifier.
Variable Reference#
Less
Sass
Jess
Jess can evaluate any continuous JavaScript expression starting with $. Referencing ends up looking a little like Sass.
Math#
Less
Sass
Jess
Depending on the type of value, and if you want to preserve units, you can use Jess helper functions. Otherwise, you can just perform your math in JavaScript.
or, to preserve units in a dimension:
Mixins#
Less
Sass
Jess
Jess mimics Sass mixin syntax, but the transpiled mixin is just a JavaScript function.
Each#
Sass
Less
Jess
The @jesscss/fns module has an each helper to achieve the same pattern.