Skip to content

Commit b6401e7

Browse files
fix: ignore custom property set (#6)
1 parent 53bd7f1 commit b6401e7

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/index.js

+9
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,15 @@ const processor = postcss.plugin('postcss-modules-scope', function(options) {
128128

129129
// Find any :local classes
130130
css.walkRules(rule => {
131+
if (
132+
rule.nodes &&
133+
rule.selector.slice(0, 2) === '--' &&
134+
rule.selector.slice(-1) === ':'
135+
) {
136+
// ignore custom property set
137+
return;
138+
}
139+
131140
let parsedSelector = selectorParser().astSync(rule);
132141

133142
rule.selector = traverseNode(parsedSelector.clone()).toString();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
:root {
2+
--title-align: center;
3+
--sr-only: {
4+
position: absolute;
5+
}
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
:root {
2+
--title-align: center;
3+
--sr-only: {
4+
position: absolute;
5+
}
6+
}

0 commit comments

Comments
 (0)