S
S
SpideR-KOSS2017-04-24 07:25:50
Sass
SpideR-KOSS, 2017-04-24 07:25:50

Sass - can users compile?

The question may seem rather vague.
There is a template with an admin panel and primary colors, let's say main_color_1 and main_color_2.
These primary colors are used throughout the site, in a wide variety of elements.
Using Sass idealizes editing if I use the $main_color_1 and $main_color_2 variables. But there is one but.
In the template admin panel, the user must set any color for main_color_1 and main_color_2.
How to do it in Sass if it needs to be compiled?
Is this even possible or are there other options?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Khokhlov, 2017-04-24
@andrhohlov

If I understand the task correctly, your question can be shortened to "how to pass sass variables when compiling".
You can find the following answer to such a question: stackoverflow.com/questions/31148803/injecting-var...
It is long, I did not master it.
I would just save the value of the variables to a file (_variables.sass), and then run the sass compilation with this file included.

Z
zooks, 2017-04-24
@zooks

It needs to be implemented via JavaScript.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question