File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ const props = {
77 } ,
88}
99
10- const transformToStr = ( s ) =>
10+ const transformToStr = ( s : string ) =>
1111 transform ( s )
12- . map ( ( x ) => ( typeof x === 'function' ? x ( props ) : x ) )
12+ . map ( ( x : Function | string ) => ( typeof x === 'function' ? x ( props ) : x ) )
1313 . join ( '' )
1414
1515describe ( '#transform' , ( ) => {
@@ -71,4 +71,10 @@ describe('#transform', () => {
7171 'div{color:#000;}@media(min-width:1920px){div{color:#000;}}div{color:#000;}' ,
7272 )
7373 } )
74+
75+ it ( 'handles nested states' , ( ) => {
76+ expect ( transformToStr ( '&:hover:not(:active) { color: black; }' ) ) . toBe (
77+ '&:hover:not(:active) { color: #000; }' ,
78+ )
79+ } )
7480} )
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ import { propGetters } from './propGetters'
55// prop name is an ident: word chars, underscore and dash.
66const PROP_CHAR = `[-\\w]`
77
8- // prop value consists of non-semis unless backslash-escaped.
9- const VALUE_CHAR = `(?:\\\\.|[^\\\\;])`
8+ // prop value consists of non-semis and no curly braces unless backslash-escaped.
9+ const VALUE_CHAR = `(?:\\\\.|[^\\\\;{} ])`
1010
1111// prettier-ignore
1212const PROP_PATT = (
You can’t perform that action at this time.
0 commit comments