stephenlacy / gulp-stylus

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

Incorrect css output #175

Closed epszaw closed 8 years ago

epszaw commented 8 years ago

Hello! Having trouble with compilation to css-file. Styl: Styl file Css: Css file Dependencies:

  "dependencies": {
    "bower": "^1.7.7",
    "gulp": "^3.9.1",
    "gulp-concat": "^2.6.0",
    "gulp-insert": "^0.5.0",
    "gulp-jade": "^1.1.0",
    "gulp-stylus": "^2.3.0",
    "gulp-uglifyjs": "^0.6.2",
    "gulp.spritesmith": "^6.2.0",
    "jeet": "^6.1.2",
    "node-gyp": "^3.3.1",
    "pngjs": "^2.2.0",
    "rupture": "^0.6.1"
  },
  "devDependencies": {
    "browser-sync": "^2.11.1",
    "gulp-autoprefixer": "^3.1.0",
    "gulp-clean-css": "^2.0.7",
    "gulp-csscomb": "^3.0.7",
    "gulp-imagemin": "^3.0.1",
    "gulp-zip": "^3.2.0"
  }

Gulpfile stylus chain of tasks:

gulp.task('styl', ['concat-styl'], function() {
    return gulp.src('app/assets/styles/main.styl', {base: ''})
    .pipe(stylus({use:[jeet(), rupture()]}))
    .pipe(gulp.dest('dist/assets/css'))
    .pipe(reload({stream:true}));
})

gulp.task('concat-blocks', function() {
    return gulp.src('app/blocks/**/*.styl')
    .pipe(concat('blocks.styl', {newLine: '\n\r'}))
    .pipe(gulp.dest('app/assets/styles'), {overwrite: true})
})

gulp.task('move-import-file', function() {
    return gulp.src('app/helpers/styles/import.styl', {base: ''})
    .pipe(gulp.dest('app/assets/styles'));
})

gulp.task('concat-styl', ['move-import-file', 'concat-blocks'], function() {
    return gulp.src(['app/assets/styles/import.styl', 'app/assets/styles/blocks.styl'])
    .pipe(concat('main.styl'))
    .pipe(gulp.dest('app/assets/styles'), {overwrite: true})
})

gulp.task('css', ['styl'],function() {
    return gulp.src('dist/assets/css/*')
    .pipe(autoprefixer({
        browsers: ['last 3 versions']
    }))
    .pipe(cssComb())
    .pipe(gulp.dest('dist/assets/css/'))
    .pipe(reload({stream:true}));
})
stephenlacy commented 8 years ago

Check your tabs/indentations. Also make sure there is a . before the __title The error is a https://github.com/stylus/stylus error. Please check there.

epszaw commented 8 years ago

@stevelacy, you were right. I forgot change spaces on other work place. It was so funny - spend a lot of time to search whitespaces :) Thank!