Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Stylus merge imported CSS into the stylesheet

I have a Stylus file, looking like

@import init
@import typography
@import colors
@import 'components/*'

@import '3rdparty-stylesheet.css'

The last line is a CSS file I get from a 3rd party plugin which I want not just to stay as it is when compiled into CSS, but all the content of this file to be injected. I use Gulp.

How can I achieve it?

like image 229
Sergei Basharov Avatar asked Apr 24 '15 08:04

Sergei Basharov


2 Answers

I have found how to switch this option on:

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

And it works like a charm now, puts all imported CSS contents into a single compiled file.

like image 132
Sergei Basharov Avatar answered Oct 08 '22 22:10

Sergei Basharov


For command line I use this.

stylus --include-css index.styl

Which I find handy for testing... before incorporating into the build process.

like image 30
Jamie Popkin Avatar answered Oct 08 '22 22:10

Jamie Popkin