File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,7 @@ var selectorParser = require('postcss-selector-parser')
33var loaderUtils = require ( 'loader-utils' )
44var assign = require ( 'object-assign' )
55
6- var currentId
7- var addId = postcss . plugin ( 'add-id' , function ( ) {
6+ var addId = postcss . plugin ( 'add-id' , function ( opts ) {
87 return function ( root ) {
98 root . each ( function rewriteSelector ( node ) {
109 if ( ! node . selector ) {
@@ -21,7 +20,7 @@ var addId = postcss.plugin('add-id', function () {
2120 if ( n . type !== 'pseudo' ) node = n
2221 } )
2322 selector . insertAfter ( node , selectorParser . attribute ( {
24- attribute : currentId
23+ attribute : opts . id
2524 } ) )
2625 } )
2726 } ) . process ( node . selector ) . result
@@ -46,7 +45,7 @@ module.exports = function (css, map) {
4645
4746 // scoped css
4847 if ( query . scoped ) {
49- plugins . push ( addId )
48+ plugins . push ( addId ( { id : query . id } ) )
5049 }
5150
5251 // autoprefixer
@@ -82,7 +81,6 @@ module.exports = function (css, map) {
8281 }
8382 }
8483
85- currentId = query . id
8684 postcss ( plugins )
8785 . process ( css , opts )
8886 . then ( function ( result ) {
You can’t perform that action at this time.
0 commit comments