Uh oh!
There was an error while loading. Please reload this page.
feat: Add space-separated string support for fontVariant - #34641
feat: Add space-separated string support for fontVariant#34641gabrieldonadel wants to merge 2 commits into
Conversation
Base commit: bfb36c2 |
Base commit: bfb36c2 |
facebook-github-bot
commented
Sep 12, 2022
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
| // $FlowFixMe[incompatible-type] | ||
| const match: ?____FontVariantArray_Internal = fontVariant.match( | ||
| new RegExp(/([a-zA-Z'-]+)/gm), |
There was a problem hiding this comment.
Quoting @javache:
Can we avoid regular expressions here since it's just a string split by space? This also seems like it would cause the regex to be re-compiled on every process call.
There was a problem hiding this comment.
Sure, let me update this
facebook-github-bot
commented
Sep 13, 2022
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
react-native-bot
commented
Sep 14, 2022
This pull request was successfully merged by @gabrieldonadel in 09d4207. When will my fix make it into a release? | Upcoming Releases |
Summary
This updates
fontVariantto support space-separated string values, i.e.,'small-caps common-ligatures', thus aligning it with the CSS Fonts Module Level 4 specification as requested on #34425. This also adds unit tests to theprocessFontVariantfunction ensuring the style processing works as expected.Changelog
[General] [Added] - Add space-separated string support for fontVariant
Test Plan
This can be tested either through
processFontVariant-testsor by using the following code: