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', () => {
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 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 11import {
2- IDENT ,
3- WORD ,
2+ AUTO ,
43 COLOR ,
54 LENGTH ,
6- UNSUPPORTED_LENGTH_UNIT ,
75 PERCENT ,
8- AUTO ,
6+ UNSUPPORTED_LENGTH_UNIT ,
7+ WORD ,
98} from '../tokenTypes'
109import border from './border'
1110import boxShadow from './boxShadow'
1211import flex from './flex'
1312import flexFlow from './flexFlow'
1413import font from './font'
1514import fontFamily from './fontFamily'
15+ import fontVariant from './fontVariant'
1616import placeContent from './placeContent'
1717import textDecoration from './textDecoration'
1818import textDecorationLine from './textDecorationLine'
@@ -39,9 +39,7 @@ const margin = directionFactory({
3939 prefix : 'margin' ,
4040} )
4141const padding = directionFactory ( { prefix : 'padding' } )
42- const fontVariant = tokenStream => ( {
43- fontVariant : [ tokenStream . expect ( IDENT ) ] ,
44- } )
42+
4543const fontWeight = tokenStream => ( {
4644 fontWeight : tokenStream . expect ( WORD ) , // Also match numbers as strings
4745} )
You can’t perform that action at this time.
0 commit comments