postcss-vmax
v1.0.0
Published
Use vmax units in Edge and Internet Explorer
Downloads
89
Readme
PostCSS VMax
PostCSS VMax lets you use vmax
units in Edge and Internet Explorer.
/* before */
.example {
font-size: 1vmax;
}
/* after */
@media (orientation: landscape) {
.example {
font-size: 1vw;
}
}
@media (orientation: portrait) {
.example {
font-size: 1vh;
}
}
.example {
font-size: 1vmax;
}
Usage
Add PostCSS VMax to your build tool:
npm install postcss-vmax --save-dev
Node
require('postcss-vmax').process(YOUR_CSS, { /* options */ });
PostCSS
Add PostCSS to your build tool:
npm install postcss --save-dev
Load PostCSS VMax as a PostCSS plugin:
postcss([
require('postcss-vmax')({ /* options */ })
]).process(YOUR_CSS, /* options */);
Gulp
Add Gulp PostCSS to your build tool:
npm install gulp-postcss --save-dev
Enable PostCSS VMax within your Gulpfile:
var postcss = require('gulp-postcss');
gulp.task('css', function () {
return gulp.src('./src/*.css').pipe(
postcss([
require('postcss-vmax')({ /* options */ })
])
).pipe(
gulp.dest('.')
);
});
Grunt
Add Grunt PostCSS to your build tool:
npm install grunt-postcss --save-dev
Enable PostCSS VMax within your Gruntfile:
grunt.loadNpmTasks('grunt-postcss');
grunt.initConfig({
postcss: {
options: {
use: [
require('postcss-vmax')({ /* options */ })
]
},
dist: {
src: '*.css'
}
}
});