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', () => {
5
5
fontVariant : [ 'tabular-nums' ] ,
6
6
} )
7
7
} )
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 6
6
UNSUPPORTED_LENGTH_UNIT ,
7
7
PERCENT ,
8
8
AUTO ,
9
+ SPACE ,
9
10
} from '../tokenTypes'
10
11
import border from './border'
11
12
import boxShadow from './boxShadow'
@@ -39,9 +40,18 @@ const margin = directionFactory({
39
40
prefix : 'margin' ,
40
41
} )
41
42
const 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
+ }
45
55
const fontWeight = tokenStream => ( {
46
56
fontWeight : tokenStream . expect ( WORD ) , // Also match numbers as strings
47
57
} )
You can’t perform that action at this time.
0 commit comments