S
S
SpideR-KOSS2017-05-13 15:11:07
JavaScript
SpideR-KOSS, 2017-05-13 15:11:07

Variables in CSS vs Sass vs Less?

There is a template for CMS.
It is necessary to make it possible to change the color and other specified CSS rules for some blocks directly from the template admin panel.
That is, in fact, we need variables in CSS.
Preprocessors, as I understand it, are not suitable in my case, because the client is a complete zero, and he needs to select a color and click save, there can be no question of any compilation.
But variables in CSS are not supported by all browsers.
Any solutions?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-07-18
@kris16

In the data attribute of the button you write the selector, in the function you read

var panel_id = $(this).attr('data-target');
$("#" + panel_id).slideToggle("fast");

A
Alexander Pushkarev, 2017-05-13
@SpideR-KOSS

scss - https://github.com/leafo/scssphp
less - https://github.com/oyejorge/less.php
There are other libraries, these are the very first ones I found

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question