Magento 2 - How to change the less variables based on admin configurations?
Question
I'm working with Magento 2 - beta. I want to set the colors and other less variables in the extension's block, controller, or module, eg: @primary__color
.
Anyone know how to do this?
I want to set the values of the less variables dynamically based on admin color configurations.
Solution
If I understand your question correctly, the answer is you cannot. Less is not for dynamic CSS generation in production. It is more like a compiler than an interpreter.
Developers can run it in an interpretive mode where the preprocessor runs in the browser, but for performance reasons not recommended in production. See http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-guide/css_quick_guide_mode.html for more information on modes.