File tree 2 files changed +10
-2
lines changed
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -316,8 +316,8 @@ export default class LessParser extends Parser {
316
316
}
317
317
}
318
318
319
- // we don't want to add params for pseudo-selectors that utilize parens (#56)
320
- if ( ( extend || ! colon ) && ( brackets . length > 0 || type === 'brackets' || params [ 0 ] ) ) {
319
+ // we don't want to add params for pseudo-selectors that utilize parens (#56) or bracket selectors (#96)
320
+ if ( ( extend || ! colon ) && ( brackets . length > 0 || type === 'brackets' || params [ 0 ] ) && brackets [ 0 ] !== ']' ) {
321
321
params . push ( token ) ;
322
322
}
323
323
Original file line number Diff line number Diff line change @@ -15,5 +15,13 @@ describe('Parser', () => {
15
15
expect ( root . first . params ) . to . be . undefined ;
16
16
} ) ;
17
17
18
+ it ( 'should not assign parameters for bracket selectors' , ( ) => {
19
+ const code = '.test1,.test2[test=test] {}' ;
20
+ const root = parse ( code ) ;
21
+
22
+ expect ( root . first . selector ) . to . eql ( '.test1,.test2[test=test]' ) ;
23
+ expect ( root . first . params ) . to . be . undefined ;
24
+ } ) ;
25
+
18
26
} ) ;
19
27
} ) ;
You can’t perform that action at this time.
0 commit comments