stephenlacy / gulp-stylus

Stylus plugin for gulp
MIT License
223 stars 60 forks source link

Include styl file #189

Closed malcocerGit closed 7 years ago

malcocerGit commented 7 years ago

I want to add a style file with some variables in a stylus for gulp task, my code looks like this :

gulp.src(['input/stylus/theme_*.styl'])
    .pipe(plumber({
      errorHandler: function (error) {
        console.log(error.message);
        this.emit('end');
    }}))
    .pipe(stylus({'include css': true, use: [nib(), rupture()]}))
    .pipe(rename({suffix: '.min',extname: ".css"}))
    .pipe(cssnano())
    .pipe(gulp.dest('../assets/'))
.pipe(browserSync.reload({stream:true}))

I searching some example, but nothing about it

Regards

stephenlacy commented 7 years ago

I have no clue what you are asking. Do you want to @import a stylus file from another file?

malcocerGit commented 7 years ago

Hi, I know you can add @import from stylus file, but I have varios "theme.styl" each one have a variables, and only I have a one "base.styl".

I wanted compile "base.styl" including the " theme.styl", but if I use "@import" I should create one "base.styl" for each "theme.styl".

I thinks do it by gulpstask is more efficient, but I didn't find any example.

malcocerGit commented 7 years ago

I found a correct way to it, thanks for all.

I wanted for 'import' : __dirname + '/stylus/themes/' + theme + '.styl',