File tree 3 files changed +9
-7
lines changed
3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 8
8
},
9
9
"dependencies" : {
10
10
"debug" : " ^2.2.0" ,
11
+ "icss-replace-symbols" : " ^1.0.2" ,
11
12
"lodash.assign" : " ^3.2.0" ,
12
13
"lodash.identity" : " ^3.0.0" ,
13
14
"lodash.isarray" : " ^3.0.4" ,
18
19
"devDependencies" : {
19
20
"babel" : " ^5.8.20" ,
20
21
"babel-eslint" : " ^4.0.5" ,
21
- "css-modules-loader-core" : " 0 .0.12 " ,
22
+ "css-modules-loader-core" : " ^1 .0.0 " ,
22
23
"eslint" : " ^1.0.0" ,
23
24
"eslint-config-airbnb" : " 0.0.7" ,
24
25
"eslint-config-airbnb-lite" : " ^1.0.3" ,
31
32
"postcss-modules-extract-imports" : " ^1.0.0" ,
32
33
"postcss-modules-local-by-default" : " ^1.0.0" ,
33
34
"postcss-modules-scope" : " ^1.0.0" ,
35
+ "postcss-modules-values" : " ^1.1.0" ,
34
36
"precommit-hook" : " ^3.0.0"
35
37
},
36
38
"peerDependencies" : {
37
39
"postcss" : " ^5.x" ,
38
40
"postcss-modules-extract-imports" : " ^1.0.0" ,
39
41
"postcss-modules-local-by-default" : " ^1.0.0" ,
40
- "postcss-modules-scope" : " ^1.0.0"
42
+ "postcss-modules-scope" : " ^1.0.0" ,
43
+ "postcss-modules-values" : " ^1.1.0"
41
44
},
42
45
"scripts" : {
43
46
"start" : " esw -w ." ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import identity from 'lodash.identity';
8
8
import pick from 'lodash.pick' ;
9
9
import postcss from 'postcss' ;
10
10
11
+ import Values from 'postcss-modules-values' ;
11
12
import ExtractImports from 'postcss-modules-extract-imports' ;
12
13
import LocalByDefault from 'postcss-modules-local-by-default' ;
13
14
import Scope from 'postcss-modules-scope' ;
@@ -71,6 +72,7 @@ export default function setup(opts = {}) {
71
72
72
73
plugins = [
73
74
...prepend ,
75
+ Values ,
74
76
mode
75
77
? new LocalByDefault ( { mode : opts . mode } )
76
78
: LocalByDefault ,
Original file line number Diff line number Diff line change 1
1
import { plugin } from 'postcss' ;
2
+ import replaceSymbols from 'icss-replace-symbols' ;
2
3
3
4
const importRegexp = / ^ : i m p o r t \( ( .+ ) \) $ / ;
4
5
@@ -30,11 +31,7 @@ export default plugin('parser', function parser(opts = {}) {
30
31
} ) ;
31
32
} ;
32
33
33
- const linkImportedSymbols = css => css . eachDecl ( decl => {
34
- Object . keys ( translations ) . forEach ( translation => {
35
- decl . value = decl . value . replace ( translation , translations [ translation ] ) ;
36
- } ) ;
37
- } ) ;
34
+ const linkImportedSymbols = css => replaceSymbols ( css , translations ) ;
38
35
39
36
const handleExport = exportNode => {
40
37
exportNode . each ( decl => {
You can’t perform that action at this time.
0 commit comments