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.

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top