Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-unwrap-at-media

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-unwrap-at-media

PostCSS plugin to unwrap @media rules to make styles IE8 (and older) friendly.

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

PostCSS Unwrap @media

Build Status

PostCSS plugin to unwrap @media rules to make styles IE8 (and older) friendly.

/* Input example */
.block {
  width: 100%;
}
@media (min-width: 720px) {
  .block {
    float: left;
    width: 25%;
  }
}
/* Output example */
.block {
  width: 100%;
}
.block {
  float: left;
  width: 25%;
}

Usage

Basic usage:

postcss([ require('postcss-unwrap-at-media') ])

Here is an example of Gulpfile which create two versions of styles:

var gulp = require('gulp');
var less = require('gulp-less');
var postcss = require('gulp-postcss');
var rename = require('gulp-rename');
var unwrapAtMedia = require('postcss-unwrap-at-media');
 
gulp.task('default', function () {
  return gulp.src('./src/**/*.less')
    .pipe(less())
    .pipe(gulp.dest('./dist/'))
    .pipe(postcss([ unwrapAtMedia ]))
    .pipe(rename({ suffix: '.ie8' }))
    .pipe(gulp.dest('./dist/'));
});

See PostCSS docs for examples for your environment.

Configuration

You can provide a list of strings or functions to match unwanted @-rules.

postcss([ unwrapAtMedia({ disallow: 'print' })])
postcss([ unwrapAtMedia({ disallow: ['print', 'screen'] })])
postcss([ unwrapAtMedia({ disallow: [
    'print',
    atRule => /min-width: 720px/.test(atRule.params)
] })])

Keywords

FAQs

Package last updated on 09 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc