postcss-vmax

1.0.0 • Public • Published

PostCSS VMax PostCSS Logo

NPM Version Build Status Licensing Changelog Gitter Chat

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'
        }
    }
});

Package Sidebar

Install

npm i postcss-vmax

Weekly Downloads

41

Version

1.0.0

License

CC0-1.0

Last publish

Collaborators

  • romainmenke
  • alaguna
  • jonathantneal