Socket
Socket
Sign inDemoInstall

stylecow-plugin-nested-rules

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylecow-plugin-nested-rules - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

tests/1.css

27

index.js

@@ -10,11 +10,28 @@ module.exports = function (stylecow) {

var space = ' ';
var prepend = false;
if (childSelector.name[0] === '&') {
childSelector.name = childSelector.name.substr(1);
childSelector[0].name = childSelector[0].name.substr(1);
space = '';
if (/^\w/.test(childSelector[0].name)) {
prepend = true;
}
}
ruleSelectors.forEach(function (ruleSelector) {
var selector = stylecow.css.Selector.create(ruleSelector.name + space + childSelector.name);
child.add(selector);
var code;
if (prepend) {
var content = ruleSelector.content;
code = content.slice(0, -1);
code.push(childSelector[0].name);
code.push(content.slice(-1));
code = code.concat(childSelector.slice(1)).join('');
} else {
code = ruleSelector.name + space + childSelector.name;
}
child.add(stylecow.css.Selector.create(code));
});

@@ -27,4 +44,8 @@

});
if (rule.children('Selector').length === rule.length) {
rule.remove();
}
}
}
};

2

package.json
{
"name": "stylecow-plugin-nested-rules",
"description": "Stylecow plugin to add support for nested rules.",
"version": "1.0.2",
"version": "1.0.3",
"author": "Oscar Otero <oom@oscarotero.com>",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/stylecow/stylecow-plugin-nested-rules",

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