我想在我的一个大css文件上使用uncss,但是这样做会破坏我的引导导航的下拉列表。
以下是工作部分:http://metalotechnika.com
这是我使用uncss:http://metalotechnika.horyzon.de的部分。
您会注意到下拉菜单不起作用。这是使用twitter引导导航条。
我的吞咽文件的部分看起来如下:
gulp.task('uncss', function() {
return gulp.src('style.css')
.pipe(uncss({
html: ['uncss/uncss.html']
}))
.pipe(gulp.dest(''));
});即使我在这里选择了一个URL,它也会中断。我暂时禁用了生产站点上的缓存和css压缩,这样您就可以看到style.css中的重要区别,即获得"uncss“。
如何使用uncss减少我的css?为什么它坏了,我怎么解决这个问题呢?
发布于 2015-04-11 19:39:05
将菜单使用的类添加到“忽略”列表中,如下所示:
gulp.task('uncss', function() {
return gulp.src('style.css')
.pipe(uncss({
html: ['uncss/uncss.html'],
ignore: [
".fade",
".fade.in",
".collapse",
".collapse.in",
".collapsing",
/\.open/
]
}))
.pipe(gulp.dest(''));});
来自这个线程:https://github.com/giakki/uncss/issues/64
您可以根据需要在列表中添加或删除类。
发布于 2020-01-15 18:57:37
对于我来说,下面的“忽略列表成功了”--我添加了/\.dropdown/
gulp.task('uncss', function() {
return gulp.src('style.css')
.pipe(uncss({
html: ['uncss/uncss.html'],
ignore: [
".fade",
".fade.in",
".collapse",
".collapse.in",
".collapsing",
/\.open/,
/\.dropdown/
]
}))
.pipe(gulp.dest(''));
});https://stackoverflow.com/questions/28082782
复制相似问题