fix: rename font-variant-caps to font-variant and parse font-variant#347
Open
5ZYSZ3K wants to merge 1 commit into
Open
fix: rename font-variant-caps to font-variant and parse font-variant#3475ZYSZ3K wants to merge 1 commit into
5ZYSZ3K wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds parsing support for font-variant(-caps) declarations by renaming font-variant-caps to font-variant and handling font-variant in the custom declaration parser.
Changes:
- Map
font-variant-capstofont-variantinpropertyRename - Add
font-variantparsing branch that validates values viaparseFontVariantCapsbefore adding a descriptor
Comment on lines
+1002
to
+1009
| const parsedFontVariant = parseFontVariantCaps( | ||
| parseUnparsed( | ||
| declaration.value.value, | ||
| builder, | ||
| property, | ||
| ) as FontVariantCaps, | ||
| builder, | ||
| ); |
Author
There was a problem hiding this comment.
I followed what was already there in an else if statement above. declaration.value isn't even the correct type
Comment on lines
+1002
to
+1009
| const parsedFontVariant = parseFontVariantCaps( | ||
| parseUnparsed( | ||
| declaration.value.value, | ||
| builder, | ||
| property, | ||
| ) as FontVariantCaps, | ||
| builder, | ||
| ); |
Author
There was a problem hiding this comment.
I couldn't really think of a better solution here in this architecture - parseFontVariantCaps checks, if the value argument is the correct string, but it also expects that argument to be of FontVariantCaps type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
font-variantandfont-variant-capsboth were broken:font-variant-capswas being parsed correctly byparseFontVariantCapsDeclaration, but it ended up asfontVariantCapsstyle, which is not correct, such a style doesn't exist inreact-native. I added a rename for that.To make
font-variantwork, I parsed it as a custom value (for some reason, it is treated as a custom value bylightningcss, and then treated it asfontVariantCaps)