File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -5,3 +5,11 @@ it('transforms font variant as an array', () => {
55 fontVariant : [ 'tabular-nums' ] ,
66 } )
77} )
8+
9+ it ( 'transforms multiple font variant as an array' , ( ) => {
10+ expect (
11+ transformCss ( [ [ 'font-variant' , 'tabular-nums oldstyle-nums' ] ] )
12+ ) . toEqual ( {
13+ fontVariant : [ 'tabular-nums' , 'oldstyle-nums' ] ,
14+ } )
15+ } )
Original file line number Diff line number Diff line change 66 UNSUPPORTED_LENGTH_UNIT ,
77 PERCENT ,
88 AUTO ,
9+ SPACE ,
910} from '../tokenTypes'
1011import border from './border'
1112import boxShadow from './boxShadow'
@@ -39,9 +40,18 @@ const margin = directionFactory({
3940 prefix : 'margin' ,
4041} )
4142const padding = directionFactory ( { prefix : 'padding' } )
42- const fontVariant = tokenStream => ( {
43- fontVariant : [ tokenStream . expect ( IDENT ) ] ,
44- } )
43+ const fontVariant = tokenStream => {
44+ const values = [ tokenStream . expect ( IDENT ) ]
45+
46+ while ( tokenStream . hasTokens ( ) ) {
47+ tokenStream . expect ( SPACE )
48+ values . push ( tokenStream . expect ( IDENT ) )
49+ }
50+
51+ return {
52+ fontVariant : values ,
53+ }
54+ }
4555const fontWeight = tokenStream => ( {
4656 fontWeight : tokenStream . expect ( WORD ) , // Also match numbers as strings
4757} )
You can’t perform that action at this time.
0 commit comments