gulp-pixrem
Advanced tools
Comparing version
{ | ||
"name": "gulp-pixrem", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Pixrem plugin for gulp.", | ||
@@ -26,3 +26,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"pixrem": "~0.1.3", | ||
"pixrem": "~0.1.4", | ||
"through2": "~0.4.1", | ||
@@ -29,0 +29,0 @@ "gulp-util": "~2.2.14" |
@@ -19,3 +19,3 @@ # gulp-pixrem [](http://badge.fury.io/js/gulp-pixrem) [](https://travis-ci.org/gummesson/gulp-pixrem) | ||
gulp.task('css', function() { | ||
gulp.src('css/*.css') | ||
gulp.src('css/style.css') | ||
.pipe(pixrem()) | ||
@@ -22,0 +22,0 @@ .pipe(gulp.dest('public/css/')); |
35
test.js
/* Modules */ | ||
var assert = require('assert'); | ||
var gutil = require('gulp-util'); | ||
var pixrem = require('./index'); | ||
var gutil = require('gulp-util'); | ||
var pixrem = require('./'); | ||
/* Tests */ | ||
it('should postprocess CSS using Pixrem', function(done) { | ||
var stream = pixrem(); | ||
describe('gulp-pixrem', function() { | ||
it('should postprocess CSS using Pixrem with the default pixel root value', function(done) { | ||
var stream = pixrem(); | ||
stream.on('data', function(data) { | ||
assert.equal(data.contents.toString(), 'code { font-size: 14px; font-size: 0.875rem; }'); | ||
done(); | ||
stream.on('data', function(data) { | ||
assert.equal(data.contents.toString(), 'code { font-size: 14px; font-size: 0.875rem; }'); | ||
done(); | ||
}); | ||
stream.write(new gutil.File({ | ||
contents: new Buffer('code { font-size: 0.875rem; }') | ||
})); | ||
}); | ||
stream.write(new gutil.File({ | ||
contents: new Buffer('code { font-size: 0.875rem; }') | ||
})); | ||
it('should postprocess CSS using Pixrem with a custom pixel root value', function(done) { | ||
var stream = pixrem('10px'); | ||
stream.on('data', function(data) { | ||
assert.equal(data.contents.toString(), 'code { font-size: 10px; font-size: 1rem; }'); | ||
done(); | ||
}); | ||
stream.write(new gutil.File({ | ||
contents: new Buffer('code { font-size: 1rem; }') | ||
})); | ||
}); | ||
}); |
4243
12.79%51
30.77%Updated