Socket
Socket
Sign inDemoInstall

postcss-modules-local-by-default

Package Overview
Dependencies
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-modules-local-by-default - npm Package Compare versions

Comparing version 4.0.3 to 4.0.4

2

package.json
{
"name": "postcss-modules-local-by-default",
"version": "4.0.3",
"version": "4.0.4",
"description": "A CSS Modules transform to make local scope the default",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -233,2 +233,7 @@ "use strict";

}
case "nesting": {
if (node.value === "&") {
context.hasLocals = true;
}
}
}

@@ -361,3 +366,3 @@

const validIdent =
/^-?([a-z\u0080-\uFFFF_]|(\\[^\r\n\f])|-)((\\[^\r\n\f])|[a-z\u0080-\uFFFF_0-9-])*$/i;
/^-?([a-z\u0080-\uFFFF_]|(\\[^\r\n\f])|-(?![0-9]))((\\[^\r\n\f])|[a-z\u0080-\uFFFF_0-9-])*$/i;

@@ -524,6 +529,8 @@ /*

globalKeyframes = false;
} else if (!globalMode) {
if (atRule.params && !localAliasMap.has(atRule.params)) {
atRule.params = ":local(" + atRule.params + ")";
}
} else if (
atRule.params &&
!globalMode &&
!localAliasMap.has(atRule.params)
) {
atRule.params = ":local(" + atRule.params + ")";
}

@@ -538,2 +545,38 @@

});
} else if (/scope$/i.test(atRule.name)) {
atRule.params = atRule.params
.split("to")
.map((item) => {
const selector = item.trim().slice(1, -1).trim();
const context = localizeNode(
selector,
options.mode,
localAliasMap
);
context.options = options;
context.localAliasMap = localAliasMap;
if (pureMode && context.hasPureGlobals) {
throw atRule.error(
'Selector in at-rule"' +
selector +
'" is not pure ' +
"(pure selectors must contain at least one local class or id)"
);
}
return `(${context.selector})`;
})
.join(" to ");
atRule.nodes.forEach((declaration) => {
if (declaration.type === "decl") {
localizeDeclaration(declaration, {
localAliasMap,
options: options,
global: globalMode,
});
}
});
} else if (atRule.nodes) {

@@ -540,0 +583,0 @@ atRule.nodes.forEach((declaration) => {

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