Sass supports a handful of useful operators for working with different values.
These include the standard mathematical operators like + and *, as well as operators for various other types:
==and!=are used to check if two values are the same.+,-,*,/, and%have their usual mathematical meaning for numbers, with special behaviors for units that matches the use of units in scientific math.<,<=,>, and>=check whether two numbers are greater or less than one another.and,or, andnothave the usual boolean behavior. Sass considers every value “true” except forfalseandnull.+,-, and/can be used to concatenate strings.
Order of Operations
Sass has a pretty standard order of operations, from tightest to loosest:
- The unary operators not,
+,-, and/. - The
*,/, and%operators. - The
+and-operators. - The
>,>=,<and<=operators. - The
==and!=operators. - The
andoperator. - The
oroperator. - The
=operator, when it's available.