Skip to content

Commit 7acdeba

Browse files
committed
make the default naming i__ until PostCSS ignores leading underscores
1 parent eb0cb4b commit 7acdeba

File tree

9 files changed

+40
-40
lines changed

9 files changed

+40
-40
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const processor = postcss.plugin('modules-extract-imports', function(options) {
88
return (css) => {
99
let imports = {};
1010
let importIndex = 0;
11-
let createImportedName = options && options.createImportedName || ((importName/*, path*/) => `__imported_${importName}_${importIndex++}`);
11+
let createImportedName = options && options.createImportedName || ((importName/*, path*/) => `i__imported_${importName}_${importIndex++}`);
1212

1313
// Find any declaration that supports imports
1414
css.eachDecl(declFilter, (decl) => {
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
:import("path/library.css") {
2-
__imported_importName_0: importName;
3-
__imported_secondImport_1: secondImport;
4-
__imported_thirdImport_2: thirdImport;
2+
i__imported_importName_0: importName;
3+
i__imported_secondImport_1: secondImport;
4+
i__imported_thirdImport_2: thirdImport;
55
}
66
:import("path/other-lib.css") {
7-
__imported_otherLibImport_3: otherLibImport;
7+
i__imported_otherLibImport_3: otherLibImport;
88
}
99
:local(.exportName) {
10-
extends: __imported_importName_0 __imported_secondImport_1;
10+
extends: i__imported_importName_0 i__imported_secondImport_1;
1111
other: rule;
1212
}
1313
:local(.otherExport) {
14-
extends: __imported_thirdImport_2;
15-
extends: __imported_otherLibImport_3;
14+
extends: i__imported_thirdImport_2;
15+
extends: i__imported_otherLibImport_3;
1616
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
:import("path/library.css") {
2-
__imported_importName_0: importName;
3-
__imported_importName2_1: importName2;
2+
i__imported_importName_0: importName;
3+
i__imported_importName2_1: importName2;
44
}
55

66
@media screen {
77
:local(.exportName) {
8-
extends: __imported_importName_0;
9-
extends: __imported_importName2_1;
8+
extends: i__imported_importName_0;
9+
extends: i__imported_importName2_1;
1010
other: rule2;
1111
}
1212
}
1313

1414
:local(.exportName) {
15-
extends: __imported_importName_0;
15+
extends: i__imported_importName_0;
1616
other: rule;
1717
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:import("path/library.css") {
2-
__imported_importName_0: importName;
3-
__imported_secondImport_1: secondImport;
2+
i__imported_importName_0: importName;
3+
i__imported_secondImport_1: secondImport;
44
}
5-
:local(.exportName) { extends: __imported_importName_0 __imported_secondImport_1; other: rule; }
5+
:local(.exportName) { extends: i__imported_importName_0 i__imported_secondImport_1; other: rule; }
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
:import("path/library.css") {
2-
__imported_importName_0: importName;
3-
__imported_secondImport_1: secondImport;
4-
__imported_importName2_3: importName2;
2+
i__imported_importName_0: importName;
3+
i__imported_secondImport_1: secondImport;
4+
i__imported_importName2_3: importName2;
55
}
66
:import("path/library2.css") {
7-
__imported_importName_2: importName;
7+
i__imported_importName_2: importName;
88
}
99
:import("path/dep3.css") {
10-
__imported_thirdDep_4: thirdDep;
10+
i__imported_thirdDep_4: thirdDep;
1111
}
1212
:local(.exportName) {
13-
extends: __imported_importName_0 __imported_secondImport_1;
14-
extends: __imported_importName_2;
15-
extends: __imported_importName2_3;
13+
extends: i__imported_importName_0 i__imported_secondImport_1;
14+
extends: i__imported_importName_2;
15+
extends: i__imported_importName2_3;
1616
}
1717
:local(.exportName2) {
18-
extends: __imported_secondImport_1;
19-
extends: __imported_secondImport_1;
20-
extends: __imported_thirdDep_4;
18+
extends: i__imported_secondImport_1;
19+
extends: i__imported_secondImport_1;
20+
extends: i__imported_thirdDep_4;
2121
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
:import("./b.css") {
2-
__imported_b_0: b;
2+
i__imported_b_0: b;
33
}
44
:import("./c.css") {
5-
__imported_c_1: c;
5+
i__imported_c_1: c;
66
}
77
.a {
8-
extends: __imported_b_0;
9-
extends: __imported_c_1;
8+
extends: i__imported_b_0;
9+
extends: i__imported_c_1;
1010
color: #aaa;
1111
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:import("path/library.css") {
2-
__imported_importName_0: importName;
2+
i__imported_importName_0: importName;
33
}
44
:local(.exportName) {
5-
extends: __imported_importName_0;
5+
extends: i__imported_importName_0;
66
other: rule;
77
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
:import("path/library.css") {
2-
__imported_importName_0: importName;
3-
__imported_importName2_1: importName2;
2+
i__imported_importName_0: importName;
3+
i__imported_importName2_1: importName2;
44
}
55
:local(.exportName) {
6-
extends: __imported_importName_0;
7-
extends: __imported_importName2_1;
8-
extends: __imported_importName_0 __imported_importName2_1;
6+
extends: i__imported_importName_0;
7+
extends: i__imported_importName2_1;
8+
extends: i__imported_importName_0 i__imported_importName2_1;
99
other: rule;
1010
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
:import("path/library.css") {
2-
__imported_importName_0: importName;
2+
i__imported_importName_0: importName;
33
}
44
:local(.exportName) {
5-
extends: __imported_importName_0;
5+
extends: i__imported_importName_0;
66
other: rule;
77
}

0 commit comments

Comments
 (0)