necolas / react-native-web

Cross-platform React UI packages
https://necolas.github.io/react-native-web
MIT License
21.69k stars 1.79k forks source link

Add missing fontVariants #2732

Open benharri opened 4 weeks ago

benharri commented 4 weeks ago

Is there an existing issue for this?

Describe the issue

additional font variants are available in react native https://github.com/facebook/react-native/blob/e5dd7d68bf264669fc5c4ce5e69b24249d28558b/packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts#L440C17-L472C24

applying any of the missing ones in react-native-web causes them to be silently ignored

Expected behavior

fontVariants are applied correctly

Steps to reproduce

add a fontVariant that isn't available https://github.com/necolas/react-native-web/blob/a5ba27c6226aa182979a9cff8cc23c0f5caa4d88/packages/react-native-web/src/exports/Text/types.js#L38-L42

Test case

https://codesandbox.io/p/sandbox/cool-resonance-3kqps8?workspaceId=af88e762-6261-40a3-a475-c631585426e7

Additional comments

No response