File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ export default postcss.plugin('postcss-nested-props', () => {
1616
1717const HAS_COLON = / : / ;
1818const ALL_PSEUDO = pseudoClasses ( ) . concat ( pseudoElements ( ) ) ;
19- const HAS_PSEUDO_CLASSES_ELEMENTS = new RegExp ( `:(${ ALL_PSEUDO . join ( '|' ) } )` ) ;
19+ const VENDOR_PSEUDO_ELEMENTS = '-(\\w|-)+' ;
20+ const HAS_PSEUDO_CLASSES_ELEMENTS = new RegExp ( `:(${ ALL_PSEUDO . join ( '|' ) } |${ VENDOR_PSEUDO_ELEMENTS } )` ) ;
2021
2122function unwrapRule ( namespace : string [ ] , rule : postcss . Rule ) {
2223 if ( ! HAS_COLON . test ( rule . selector ) ) {
Original file line number Diff line number Diff line change @@ -65,6 +65,21 @@ describe('postcss-nested-props plugin', () => {
6565 } ) ;
6666 } ) ;
6767
68+ describe ( 'vendor pseudo elements' , ( ) => {
69+ [
70+ '-ms-clear' ,
71+ '-webkit-progress-bar' ,
72+ '-moz-focus-outer'
73+ ] . forEach ( vendorPseudoElement => {
74+ it ( `preserves the ::${ vendorPseudoElement } pseudo-element` , ( ) => {
75+ check (
76+ `a{b::${ vendorPseudoElement } {c:d}}` ,
77+ `a{b::${ vendorPseudoElement } {c:d}}`
78+ ) ;
79+ } ) ;
80+ } ) ;
81+ } ) ;
82+
6883} ) ;
6984
7085function check ( input : string , output : string ) {
You can’t perform that action at this time.
0 commit comments