postcss-modules-scope
Advanced tools
Comparing version 3.0.0 to 3.1.0
{ | ||
"name": "postcss-modules-scope", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "A CSS Modules transform to extract export statements from local-scope classes", | ||
@@ -48,3 +48,3 @@ "main": "src/index.js", | ||
"lint-staged": "^10.4.0", | ||
"postcss": "^8.1.0", | ||
"postcss": "^8.3.0", | ||
"prettier": "^2.1.2" | ||
@@ -51,0 +51,0 @@ }, |
@@ -94,7 +94,8 @@ "use strict"; | ||
function exportScopedName(name, rawName) { | ||
function exportScopedName(name, rawName, node) { | ||
const scopedName = generateScopedName( | ||
rawName ? rawName : name, | ||
root.source.input.from, | ||
root.source.input.css | ||
root.source.input.css, | ||
node | ||
); | ||
@@ -105,3 +106,4 @@ const exportEntry = generateExportEntry( | ||
root.source.input.from, | ||
root.source.input.css | ||
root.source.input.css, | ||
node | ||
); | ||
@@ -128,3 +130,4 @@ const { key, value } = exportEntry; | ||
node.value, | ||
node.raws && node.raws.value ? node.raws.value : null | ||
node.raws && node.raws.value ? node.raws.value : null, | ||
node | ||
), | ||
@@ -136,6 +139,17 @@ }); | ||
node.value, | ||
node.raws && node.raws.value ? node.raws.value : null | ||
node.raws && node.raws.value ? node.raws.value : null, | ||
node | ||
), | ||
}); | ||
} | ||
case "attribute": { | ||
if (node.attribute === "class" && node.operator === "=") { | ||
return selectorParser.attribute({ | ||
attribute: node.attribute, | ||
operator: node.operator, | ||
quoteMark: "'", | ||
value: exportScopedName(node.value), | ||
}); | ||
} | ||
} | ||
} | ||
@@ -157,3 +171,3 @@ | ||
const selector = localizeNode(node.first, node.spaces); | ||
// move the spaces that were around the psuedo selector to the first | ||
// move the spaces that were around the pseudo selector to the first | ||
// non-container node | ||
@@ -160,0 +174,0 @@ selector.first.spaces = node.spaces; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
277
13816
4