Skip to content

Commit a2b0e9d

Browse files
committed
switch to "composes" instead of "extends"
1 parent 7acdeba commit a2b0e9d

File tree

22 files changed

+47
-47
lines changed

22 files changed

+47
-47
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import postcss from 'postcss';
22

3-
const declWhitelist = ['extends'],
3+
const declWhitelist = ['composes'],
44
declFilter = new RegExp(`^(${declWhitelist.join('|')})$`),
55
matchImports = /^([\w\s]+?)\s+from\s+(?:"([^"]+)"|'([^']+)')$/;
66

test/custom-import-name.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ var processor = require("../");
99

1010
describe("custom-import-name", function() {
1111
it("should allow to provide a custom imported name", function() {
12-
var input = ":local(.name) { extends: abc from \"def\"; }";
13-
var expected = ":import(\"def\") {\n abc-from-def: abc;\n}\n:local(.name) { extends: abc-from-def; }";
12+
var input = ":local(.name) { composes: abc from \"def\"; }";
13+
var expected = ":import(\"def\") {\n abc-from-def: abc;\n}\n:local(.name) { composes: abc-from-def; }";
1414
var pipeline = postcss([processor({
1515
createImportedName: function(importName, path) { return importName + "-from-" + path; }
1616
})]);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
:local(.exportName) {
3-
extends: importName from "path/library.css";
3+
composes: importName from "path/library.css";
44
other: rule;
55
}
66
*/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
:local(.exportName) {
3-
extends: importName from "path/library.css";
3+
composes: importName from "path/library.css";
44
other: rule;
55
}
66
*/

test/test-cases/import-consolidate/expected.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
i__imported_otherLibImport_3: otherLibImport;
88
}
99
:local(.exportName) {
10-
extends: i__imported_importName_0 i__imported_secondImport_1;
10+
composes: i__imported_importName_0 i__imported_secondImport_1;
1111
other: rule;
1212
}
1313
:local(.otherExport) {
14-
extends: i__imported_thirdImport_2;
15-
extends: i__imported_otherLibImport_3;
14+
composes: i__imported_thirdImport_2;
15+
composes: i__imported_otherLibImport_3;
1616
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

22
:local(.exportName) {
3-
extends: importName secondImport from 'path/library.css';
3+
composes: importName secondImport from 'path/library.css';
44
other: rule;
55
}
66
:local(.otherExport) {
7-
extends: thirdImport from 'path/library.css';
8-
extends: otherLibImport from 'path/other-lib.css';
7+
composes: thirdImport from 'path/library.css';
8+
composes: otherLibImport from 'path/other-lib.css';
99
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
:local(.exportName) {
2-
extends: localName;
2+
composes: localName;
33
other: rule;
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
:local(.exportName) {
2-
extends: localName;
2+
composes: localName;
33
other: rule;
44
}

test/test-cases/import-media/expected.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

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

1414
:local(.exportName) {
15-
extends: i__imported_importName_0;
15+
composes: i__imported_importName_0;
1616
other: rule;
1717
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
@media screen {
22
:local(.exportName) {
3-
extends: importName from "path/library.css";
4-
extends: importName2 from "path/library.css";
3+
composes: importName from "path/library.css";
4+
composes: importName2 from "path/library.css";
55
other: rule2;
66
}
77
}
88

99
:local(.exportName) {
10-
extends: importName from "path/library.css";
10+
composes: importName from "path/library.css";
1111
other: rule;
1212
}

0 commit comments

Comments
 (0)