how to optimize Less CSS? how to generate 1 minified version of all less files? I am also using modifyVars

戏子无情 提交于 2019-12-24 08:21:04

问题


Help!

I am using Less CSS and less.js to compile all less file and now i am already done and i am optimizing the site.

I'm trying to search on web on how to optimize less css. I want to have a 1 minified file version of all my less files without generating it to back to css file since i am using modifyVars.

or is there alternative way? any suggestion or recommendation would be much appreciated.

Cheers,


回答1:


Don't use less.js in a product environment. LESS is a pre compiler you should use the resulting and optimized CSS files.

or is there alternative way? any suggestion or recommendation would be much appreciated.

Since CSS will be static you should evaluate your modifyVars usages and find an alternative: For example use javascript / jQuery to change the CSS classes on your elements conditional. See also: How to change the theme color in less css using javascript/jquery



来源:https://stackoverflow.com/questions/20233044/how-to-optimize-less-css-how-to-generate-1-minified-version-of-all-less-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!