我有一个带有可变部分的 css 文件,我想在运行构建脚本时从文件中删除它(但我需要将该部分保留在源代码中)。我想我会用某种标记将该部分包装在评论(/ * remove-front / & / remove-back */)中,然后使用ant将评论之间的所有内容都替换掉。
这是我的例子:
/* remove-front */
.footerGradients {
/* gradient settings (used http://www.colorzilla.com/gradient-editor/ to generate following code) */
background-color: #606869;
background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #2f3838), color-stop(100%, #606869));
background: -moz-linear-gradient(center bottom, #2f3838 0, #606869 100%);
background: -ms-linear-gradient(center bottom, #2f3838 0, #606869 100%);
background: -o-linear-gradient(center bottom, #2f3838 0, #606869 100%);
background: linear-gradient(center bottom, #2f3838 0, #606869 100%);
-pie-background: linear-gradient(#2f3838, #606869);
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#2f3838,endColorstr=#606869);
/* end gradient settings */
}
.footerShadows {
/* box shadow settings (used http://css3generator.com/ to generate following code) */
-webkit-box-shadow: 0 0 2px 0 #293535;
-moz-box-shadow: 0 0 2px 0 #293535;
box-shadow: 0 0 2px 0 #293535;
/* end box shadow settings */
}
/* remove-back */
提前感谢您的回复。