嗨,我正在尝试让断点 sass 在我的 Gulp 设置中与 susy 一起工作
我已经运行 npm install breakpoint-sass --save-dev 并使用 @import "./node_modules/breakpoint-sass/stylesheets/breakpoint" 将它链接到我的 sass 文件的顶部;(susy 在 @import "./node_modules/susy/sass/susy" 中运行良好;)
我的 gulp sass 任务是这样的
gulp.task("styles", function() {
return gulp.src("scss/application.scss")
.pipe( bulkSass())
.pipe(maps.init())
.pipe(sass())
.pipe(sass({
outputStyle: 'compressed',
includePaths: ['node_modules/susy/sass', 'node_modules/breakpoint-sass/stylesheets/breakpoint'],
}).on('error', sass.logError))
.pipe(maps.write('./'))
//.pipe(autoprefixer())
.pipe(gulp.dest('./build/css/'))
.pipe(reload({stream:true}))
});
和我的 scss 部分
@import "./node_modules/breakpoint-sass/stylesheets/breakpoint";
@import "./node_modules/susy/sass/susy";
#main {
@include span(12);
background: $primary-color;
text-align: center;
h1 {
color: green;
height: 2em;
}
@include breakpoint(500px){
h1{
color: red;
}
}
}
h1 标签在所有屏幕宽度上都是红色的,而不是绿色的。我不明白为什么会这样。我之前在一个带有 ruby 的 grunt 项目中使用过断点并且没有任何问题。
谢谢