Skip to content

Commit 763f3cb

Browse files
committed
feat: parse font variant numeric
1 parent 6b1f911 commit 763f3cb

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const parseFontVariant = (fontVariant: string) =>
2+
fontVariant
3+
.split(' ').filter(token => token !== 'undefined')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './boxShadow'
2+
export * from './fontVariant'
23
export * from './gradient'
34
export * from './transforms'

packages/uniwind/src/core/native/store.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Dimensions } from 'react-native'
22
import { Orientation, StyleDependency } from '../../types'
33
import { RNStyle, Style, StyleSheets } from '../types'
4-
import { parseBoxShadow, parseTransformsMutation, resolveGradient } from './parsers'
4+
import { parseBoxShadow, parseFontVariant, parseTransformsMutation, resolveGradient } from './parsers'
55
import { UniwindRuntime } from './runtime'
66

77
export class UniwindStoreBuilder {
@@ -175,6 +175,10 @@ export class UniwindStoreBuilder {
175175
result.borderColor = '#000000'
176176
}
177177

178+
if (result.fontVariant !== undefined) {
179+
result.fontVariant = parseFontVariant(result.fontVariant)
180+
}
181+
178182
parseTransformsMutation(result)
179183

180184
if (result.experimental_backgroundImage !== undefined) {

packages/uniwind/src/metro/processor/rn.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ const cssToRNMap: Record<string, (value: any) => Record<string, any>> = {
170170
transformOrigin: value,
171171
}
172172
},
173+
fontVariantNumeric: value => ({
174+
fontVariant: value,
175+
}),
173176
}
174177

175178
export class RN {

0 commit comments

Comments
 (0)