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

postcss-prefixwrap

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-prefixwrap

A PostCSS plugin that is used to wrap css styles with a css selector to constrain their affect on parent elements in a page.

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
63K
increased by14.13%
Maintainers
1
Weekly downloads
 
Created
Source

PostCSS Prefix Wrap v0.0.5 Build Status NPM Version

A PostCSS plugin that is used to wrap css styles with a css selector to constrain their affect on parent elements in a page.

Dependencies

Contributors

Getting Started

0. Ensure all Dependencies have been resolved.

1. Install the Node module:

npm install --save-dev postcss-prefixwrap

2. Load the module in your build configuration:

var prefixwrap = require("postcss-prefixwrap");

3. Instantiate the PostCSS plugin:

// This will be a class on the container div.
var wrapSelector = ".my-custom-wrap";

// Postcss config for some workflow such as webpack.
{
  postcss: [
    prefixwrap(wrapSelector)
  ]
}

4. Add the container to your markup:

<div class="my-custom-wrap">
<!-- Your existing markup. -->
</div>

5. Your css will now be contained:

/* Before */

p {
  color: red;
}

body {
  font-size: 16px;
}
/* After */

.my-custom-wrap p {
  color: red;
}

.my-custom-wrap {
  font-size: 16px;
}

Testing

See https://travis-ci.org/dbtedman/postcss-prefixwrap for CI results, run on each commit.

Static Analysis

Code is linted using ESLint:

npm run test:lint

FAQs

Package last updated on 27 Sep 2016

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