dlmanning / gulp-sass

SASS plugin for gulp
MIT License
1.57k stars 381 forks source link

How to include separate css without file concatenation? #852

Open matiev opened 2 years ago

matiev commented 2 years ago

How to include separate css without file concatenation(copying/grouping) properties)?

Structure folder src folder sass folder block base.sass header.sass main.sass

main.sass @import block/base @import block/header

./public/... converted to main.css @import 'block/base.css' @import 'block/header.css'

and folter block

gulpfile.js const scss = () => { return src('./src/sass/*/.sass') .pipe(sass()) .pipe(dest('./public/css/')) .pipe(browserSync.stream()) }

wkillerud commented 2 years ago

Not sure I understand the problem, but if you want main.css to not have the content of block/base and block/header – instead use CSS import to load CSS in the browser – then in main.sass:

@import "block/base.css"
@import "block/header.css"

That way Sass treats @import as a CSS import.

matiev commented 2 years ago

Thanks for the answer. This is what I needed, it helped