Skip to content

implico/postcss-unwrap-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postcss-unwrap-helper

Unwrap container contents with PostCSS

Install

$ npm install postcss-unwrap-helper
$ yarn add postcss-unwrap-helper

Usage

This is not a PostCSS plugin, just exposes a helper function that unwraps a node, preserving the correct whitespace.

import postcss from 'postcss';
import unwrapHelper from 'postcss-unwrap-helper';

// Am example plugin that unwraps all media queries
postcss.plugin('postcss-unwrap-all-media-queries', () => root => {
  root.walkAtRules('media', unwrapHelper);
};

Input CSS:

@media screen and (min-width: 960px) {
  div {
    display: block;
  }
}

span {
  display: flex;
}

Output CSS:

div {
  display: block;
}

span {
  display: flex;
}

About

Unwrap container contents with PostCSS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published