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.


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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.