如何优化Less CSS?如何生成所有较少文件的1个缩小版本?我也在使用ModifyVars [英] how to optimize Less CSS? how to generate 1 minified version of all less files? I am also using modifyVars
问题描述
帮助!
我正在使用Less CSS和less.js来编译所有更少的文件,现在我已经完成了,并且正在优化站点.
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.
我正在尝试在网络上搜索有关如何优化CSS的方法.我想拥有我所有较少文件的1缩小文件版本,而又不生成它以使其返回到CSS文件,因为我正在使用ModifyVars.
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.
干杯
推荐答案
请勿在产品环境中使用less.js. LESS是预编译器,您应该使用生成的和优化的CSS文件.
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.
由于CSS将是静态的,因此您应该评估您的modifyVars
用法并找到替代方法:
例如,使用javascript/jQuery来有条件地更改元素上的CSS类.另请参阅:如何更改主题使用javascript/jquery减少CSS的颜色
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
这篇关于如何优化Less CSS?如何生成所有较少文件的1个缩小版本?我也在使用ModifyVars的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!