Make Stylus merge imported CSS into a stylesheet

I have a Stylus file similar to

@import init @import typography @import colors @import 'components/*' @import '3rdparty-stylesheet.css' 

The last line is the CSS file that I get from a third-party plugin that I want to not just stay as it compiles into CSS, but all the content of this file that needs to be inserted. I am using gulp.

How can i achieve this?

+6
source share
2 answers

I found how to enable this option:

  gulp.src('./app/styl/style.styl') .pipe(stylus({ 'include css': true })) .pipe(gulp.dest('./dist/css')); 

And now it works like a charm, it puts all the imported CSS content into one compiled file.

+10
source

For the command line, I use this.

stylus --include-css index.styl

which is convenient for me to test ... before including it in the build process.

+3
source

Source: https://habr.com/ru/post/985854/


All Articles