File tree Expand file tree Collapse file tree 3 files changed +27
-7
lines changed Expand file tree Collapse file tree 3 files changed +27
-7
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
1
+ import { SPACE , IDENT } from '../tokenTypes'
2
+
3
+ export default tokenStream => {
4
+ const values = [ tokenStream . expect ( IDENT ) ]
5
+
6
+ while ( tokenStream . hasTokens ( ) ) {
7
+ tokenStream . expect ( SPACE )
8
+ values . push ( tokenStream . expect ( IDENT ) )
9
+ }
10
+
11
+ return {
12
+ fontVariant : values ,
13
+ }
14
+ }
Original file line number Diff line number Diff line change 1
1
import {
2
- IDENT ,
3
- WORD ,
2
+ AUTO ,
4
3
COLOR ,
5
4
LENGTH ,
6
- UNSUPPORTED_LENGTH_UNIT ,
7
5
PERCENT ,
8
- AUTO ,
6
+ UNSUPPORTED_LENGTH_UNIT ,
7
+ WORD ,
9
8
} from '../tokenTypes'
10
9
import border from './border'
11
10
import boxShadow from './boxShadow'
12
11
import flex from './flex'
13
12
import flexFlow from './flexFlow'
14
13
import font from './font'
15
14
import fontFamily from './fontFamily'
15
+ import fontVariant from './fontVariant'
16
16
import placeContent from './placeContent'
17
17
import textDecoration from './textDecoration'
18
18
import textDecorationLine from './textDecorationLine'
@@ -39,9 +39,7 @@ const margin = directionFactory({
39
39
prefix : 'margin' ,
40
40
} )
41
41
const padding = directionFactory ( { prefix : 'padding' } )
42
- const fontVariant = tokenStream => ( {
43
- fontVariant : [ tokenStream . expect ( IDENT ) ] ,
44
- } )
42
+
45
43
const fontWeight = tokenStream => ( {
46
44
fontWeight : tokenStream . expect ( WORD ) , // Also match numbers as strings
47
45
} )
You can’t perform that action at this time.
0 commit comments