User-Defined Function Calls in Sass

Avoid user-defined function calls. For example, assuming that $sc-primary-color is also:

$sc-color-secondary: myfunc($sc-primary-color) /*editable(…)

In this example, you set the result of an exposed variable, such as $sc-color-secondary, to a custom function, myfunc($sc-primary-color). Assuming $sc-primary-color is also declared as editable, when the SMT administrator changes the primary color value, the primary color value compiles quickly in the frontend. The problem with this approach is that myfunc($sc-primary-color) only exists in the backend and takes longer to preview.

Leave a comment

Your email address will not be published. Required fields are marked *