How to keep duplicate properties in compiled CSS file when use LESS?

青春壹個敷衍的年華 提交于 2019-11-28 02:22:38

AS already pointed out by @seven-phases-max clean-css removes these properties.

Notice that the --advanced has been set by default. You should use the --skip-advanced option to prevent your double properties from being removed.

According to https://github.com/less/less-plugin-clean-css the advanced option has been set to false by default.

lessc foo.less outputs:

.foo {
  background-size: 200px;
  background-size: cover;
}

lessc --clean-css foo.less outputs:

.foo{background-size:200px;background-size:cover}

lessc --clean-css="advanced" foo.less outputs:

 .foo{background-size:cover}

Alternatively you could run lessc -x foo.less which also outputs:

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