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

postcss-scopify

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-scopify - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

24

index.js
'use strict';
var postcss = require('postcss');
var selectorParser = require('postcss-selector-parser');

@@ -12,2 +13,18 @@ var conditionalGroupRules = ['media','supports','document'];

// special case for the '&' selector, resolves to scope
var processor = selectorParser(function (selectors) {
var hasNestingSelector = false;
selectors.walkNesting(function (selector) {
hasNestingSelector = true;
selector.replaceWith(
selectorParser.string({value: scope})
);
});
if (!hasNestingSelector) {
selectors.first.prepend(
selectorParser.string({value: scope + ' '})
);
}
});
return function(root) {

@@ -32,9 +49,4 @@

// special case for a top level '&' selector, resolves to scope
if (selector === '&') {
return scope;
}
return processor.processSync(selector);
return scope + ' ' + selector;
});

@@ -41,0 +53,0 @@ });

{
"name": "postcss-scopify",
"version": "0.1.9",
"version": "0.1.10",
"description": "PostCSS plugin that adds a user input scope to each selector",

@@ -24,3 +24,4 @@ "keywords": [

"dependencies": {
"postcss": "^5.0.0"
"postcss": "^5.0.0",
"postcss-selector-parser": "^6.0.2"
},

@@ -32,4 +33,4 @@ "devDependencies": {

"scripts": {
"test": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha -- -u exports test/*"
"test": "istanbul cover ./node_modules/mocha/bin/_mocha -- -u exports test/*.js"
}
}
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