Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running gulp-pixrem doesn't seem to change anything #8

Open
digisavvy opened this issue Apr 16, 2017 · 0 comments
Open

Running gulp-pixrem doesn't seem to change anything #8

digisavvy opened this issue Apr 16, 2017 · 0 comments

Comments

@digisavvy
Copy link

digisavvy commented Apr 16, 2017

Hey there,
Thanks for putting this together. I'm attempting to use this and I'm not seeing any discernable differences here.

Here's my code

var browserSync  = require('browser-sync').create();
var concat       = require('gulp-concat');
var del          = require('del');
var filter       = require('gulp-filter');
var gulp         = require('gulp');
var imagemin     = require('gulp-imagemin');
var jshint       = require('gulp-jshint');
var minifycss    = require('gulp-uglifycss');
var notify       = require('gulp-notify');
var pixrem       = require('gulp-pixrem');
var plugins      = require('gulp-load-plugins')({ camelize: true });
var plumber      = require('gulp-plumber');
var reload       = browserSync.reload;
var rename       = require('gulp-rename');
var replace      = require('gulp-replace');
var runSequence  = require('gulp-run-sequence');
var sass         = require('gulp-sass');
var sourcemaps   = require('gulp-sourcemaps');
var uglify       = require('gulp-uglify');
var zip          = require('gulp-zip');
gulp.task('styles', function() {
  return gulp.src([
      source + 'sass/**/*.scss',
      '!' + source + 'sass/**/navigation-offcanvas.scss'
  ])
    .pipe(plumber({
      errorHandler: function(err) {
        console.log(err);
        this.emit('end');
      }
    }))
    .pipe(sourcemaps.init())
    .pipe(sass({
        sourceComments: 'map',
        sourceMap: 'sass',
        outputStyle: 'nested'
    }).on('error', sass.logError))
    .pipe(autoprefixer(
      'last 2 version',
      'safari 5', 'ie 8',
      'ie 9',
      'opera 12.1',
      'ios 6',
      'android 4'
    ))
    .pipe(pixrem({
      rootValue: '100%',
      map: true,
      replace: true
    }))
    .pipe(sourcemaps.write('../maps'))
    .pipe(plumber.stop())
    .pipe(replace('@charset "UTF-8";', '')) // Removes UTF-8 Encoding string atop CSS files

    .pipe(gulp.dest(source + 'css'))
    .pipe(filter('**/*.css')) // Filtering stream to only css files
    .pipe(reload({stream:true})) // Inject Styles when style file is created
    .pipe(rename({ suffix: '-min' }))
    .pipe(minifycss({
      maxLineLen: 80
    }))
    .pipe(gulp.dest(source + 'css'))
    .pipe(reload({stream:true})) // Inject Styles when min style file is created
    .pipe(notify({ message: 'Styles task complete', onLast: true }));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant