Skip to content

Commit f13d8ca

Browse files
committed
ok smarty
1 parent d6b3873 commit f13d8ca

File tree

5 files changed

+20
-7
lines changed

5 files changed

+20
-7
lines changed

src/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import postcss from 'postcss'
22
import localByDefault from 'postcss-modules-local-by-default'
33
import extractImports from 'postcss-modules-extract-imports'
44
import scope from 'postcss-modules-scope'
5+
import wip from "./wip"
56

67
import Parser from './parser'
78

@@ -26,4 +27,4 @@ export default class Core {
2627
Core.localByDefault = localByDefault
2728
Core.extractImports = extractImports
2829
Core.scope = scope
29-
Core.defaultPlugins = [localByDefault, extractImports, scope]
30+
Core.defaultPlugins = [wip, localByDefault, extractImports, scope]

src/wip.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const matchImports = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)')$/
2+
3+
export default css => {
4+
css.eachAtRule('alias', atRule => {
5+
let imports = matchImports.exec(atRule.params)
6+
if (imports) {
7+
8+
} else {
9+
console.log(atRule.params)
10+
}
11+
})
12+
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@define small: (max-width: 599px);
1+
@let small: (max-width: 599px);

test/test-cases/aliases/colors.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
@define primary: aquamarine;
2-
@define secondary: red;
1+
@let primary: aquamarine;
2+
@let secondary: red;

test/test-cases/aliases/source.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@alias "./borders.css" as borders;
2-
@alias small from "./breakpoints.css";
3-
@alias secondary, primary as blue from "./colors.css";
1+
@let borders: "./borders.css";
2+
@import small from "./breakpoints.css";
3+
@import secondary, blue as primary from "./colors.css";
44

55
.foo {
66
composes: dashed from borders;

0 commit comments

Comments
 (0)