New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

postcss-extract-styles

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-extract-styles

PostCSS plugin that extracts styles from css based on decelerations matching.

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

PostCSS Extract Styles Build Status npm

PostCSS plugin that extracts styles from css based on deceleration matching.

Options

pattern : Regex | Array

Usage

const options = {
  pattern: /{{[^\}]+}}/g
};
postcss([ require('postcss-extract-styles')(options) ]
  .then((result) => {
     result.css // would be the "remain" part
     result.extracted // would be the "extracted" part
  });

Example

.wix-tpa {
	color: {{color-1}};
	margin-left: 10px;
}
// remain
.wix-tpa {
  margin-left: 10px;
}
// extracted
.wix-tpa {
  color: {{color-1}};
}

Testing

$ npm test

See PostCSS docs for examples for your environment.

Keywords

postcss

FAQs

Package last updated on 24 Feb 2018

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