Migrating to Jess
Here are some examples of features in Less / Sass and their equivalent syntax in Jess.
#
Variable DeclarationLess
Sass
Jess
Variables are declared using the @let
at-rule. color
must be a valid JavaScript identifier.
#
Variable ReferenceLess
Sass
Jess
Jess can evaluate any continuous JavaScript expression starting with $
. Referencing ends up looking a little like Sass.
#
MathLess
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:
#
MixinsLess
Sass
Jess
Jess mimics Sass mixin syntax, but the transpiled mixin is just a JavaScript function.
#
EachSass
Less
Jess
The @jesscss/fns
module has an each
helper to achieve the same pattern.