how to optimize Less CSS? how to generate 1 minifi

2019-08-06 23:50发布

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条回答
smile是对你的礼貌
2楼-- · 2019-08-07 00:51

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

查看更多
登录 后发表回答