I need create customization of web template and give my customers form to configuration of styles.
I created styles of website in LESS, and when customer changes some setting in form (and click submit) PHP creates dynamically CSS files based on LESS code, and customer settings.
I am using less.php. But dynamically generating CSS from LESS is very slow. That is why I want to create "CSS file" with LESS variables, and I want to automatically generating final CSS file from "CSS file" with variables, and after using only str_replace() to change variable to value. It will be faster solution!
Example:
LESS file
@color: red;
.container {
.box {color: @color; }
}
final CSS file
.container .box {color: red; }
but I need to generate "CSS file" with LESS variables, like this:
.container .box {color: @color; }
How can I generate file like this?
You don't seem to understand what LESS is, LESS is a CSS preprocessor that compiles code into CSS. CSS does not support variables so what you are asking doesn't really make sense. You are using LESS PHP but you wanna actually remove that functionality. The question makes no sense to me.