File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 88 },
99 "dependencies" : {
1010 "debug" : " ^2.2.0" ,
11+ "icss-replace-symbols" : " ^1.0.2" ,
1112 "lodash.assign" : " ^3.2.0" ,
1213 "lodash.identity" : " ^3.0.0" ,
1314 "lodash.isarray" : " ^3.0.4" ,
1819 "devDependencies" : {
1920 "babel" : " ^5.8.20" ,
2021 "babel-eslint" : " ^4.0.5" ,
21- "css-modules-loader-core" : " 0 .0.12 " ,
22+ "css-modules-loader-core" : " ^1 .0.0 " ,
2223 "eslint" : " ^1.0.0" ,
2324 "eslint-config-airbnb" : " 0.0.7" ,
2425 "eslint-config-airbnb-lite" : " ^1.0.3" ,
3132 "postcss-modules-extract-imports" : " ^1.0.0" ,
3233 "postcss-modules-local-by-default" : " ^1.0.0" ,
3334 "postcss-modules-scope" : " ^1.0.0" ,
35+ "postcss-modules-values" : " ^1.1.0" ,
3436 "precommit-hook" : " ^3.0.0"
3537 },
3638 "peerDependencies" : {
3739 "postcss" : " ^5.x" ,
3840 "postcss-modules-extract-imports" : " ^1.0.0" ,
3941 "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"
4144 },
4245 "scripts" : {
4346 "start" : " esw -w ." ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import identity from 'lodash.identity';
88import pick from 'lodash.pick' ;
99import postcss from 'postcss' ;
1010
11+ import Values from 'postcss-modules-values' ;
1112import ExtractImports from 'postcss-modules-extract-imports' ;
1213import LocalByDefault from 'postcss-modules-local-by-default' ;
1314import Scope from 'postcss-modules-scope' ;
@@ -71,6 +72,7 @@ export default function setup(opts = {}) {
7172
7273 plugins = [
7374 ...prepend ,
75+ Values ,
7476 mode
7577 ? new LocalByDefault ( { mode : opts . mode } )
7678 : LocalByDefault ,
Original file line number Diff line number Diff line change 11import { plugin } from 'postcss' ;
2+ import replaceSymbols from 'icss-replace-symbols' ;
23
34const importRegexp = / ^ : i m p o r t \( ( .+ ) \) $ / ;
45
@@ -30,11 +31,7 @@ export default plugin('parser', function parser(opts = {}) {
3031 } ) ;
3132 } ;
3233
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 ) ;
3835
3936 const handleExport = exportNode => {
4037 exportNode . each ( decl => {
You can’t perform that action at this time.
0 commit comments