Skip to content

Commit cb11e64

Browse files
cottomevilebottnawi
authored andcommitted
fix: className conflict to keyword like constuctor or toString (css-modules#1)
1 parent 41f5b08 commit cb11e64

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const processor = postcss.plugin('postcss-modules-scope', function(options) {
5858
const generateScopedName =
5959
(options && options.generateScopedName) || processor.generateScopedName;
6060

61-
const exports = {};
61+
const exports = Object.create(null);
6262

6363
function exportScopedName(name) {
6464
const scopedName = generateScopedName(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
._input__constructor {
2+
color: green;
3+
}
4+
5+
._input__toString {
6+
color: red;
7+
}
8+
9+
:export {
10+
constructor: _input__constructor;
11+
toString: _input__toString;
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:local(.constructor) {
2+
color: green;
3+
}
4+
5+
:local(.toString) {
6+
color: red;
7+
}

0 commit comments

Comments
 (0)