postcss-remove-media-query-ranges

    1.0.3 • Public • Published

    Remove-media-query-ranges

    Removes media queries from CSS that don't match a give range.

    Usage

    Add [postcss-remove-media-query-ranges] to your build tool:

    npm install postcss-remove-media-query-ranges --save-dev

    Node

    require('postcss-remove-media-query-ranges')({ /* options */ }).process(YOUR_CSS);

    PostCSS

    Add [PostCSS] to your build tool:

    npm install postcss --save-dev

    Load [postcss-remove-media-query-ranges] as a PostCSS plugin:

    postcss([
        require('postcss-remove-media-query-ranges')({ /* options */ })
    ]);

    Gulp

    Add [Gulp PostCSS] to your build tool:

    npm install gulp-postcss --save-dev

    Enable [postcss-remove-media-query-ranges] within your Gulpfile:

    var postcss = require('gulp-postcss');
     
    gulp.task('css', function () {
        return gulp.src('./css/src/*.css').pipe(
            postcss([
                require('postcss-remove-media-query-ranges')({ /* options */ })
            ])
        ).pipe(
            gulp.dest('./css')
        );
    });

    Grunt

    Add [Grunt PostCSS] to your build tool:

    npm install grunt-postcss --save-dev

    Enable [postcss-remove-media-query-ranges] within your Gruntfile:

    grunt.loadNpmTasks('grunt-postcss');
     
    grunt.initConfig({
        postcss: {
            options: {
                processors: [
                    require('postcss-remove-media-query-ranges')({ /* options */ })
                ]
            },
            dist: {
                src: 'css/*.css'
            }
        }
    });

    Options

    You can define your own viewport range.

    require('postcss-remove-media-query-ranges')({
        max: 767,
        removeMax: true
    })
    require('postcss-remove-media-query-ranges')({
        min: 768,
        removeMin: true
    })
    require('postcss-remove-media-query-ranges')({
        max: 1199,
        min: 768,
        removeMin: true,
        removeMax: true
    })

    Install

    npm i postcss-remove-media-query-ranges

    DownloadsWeekly Downloads

    846

    Version

    1.0.3

    License

    ISC

    Last publish

    Collaborators

    • avatar