-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix/stylex-content-quotes #782
Conversation
@nmn this was my first approach for the content issue, lmk if need to do some fixes :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A fully spec-compliant implementation would be quite, so I think it makes sense to change the implementation to be more forgiving instead.
Let's change the hasCssFunction
to use var.includes('attributes(')
etc. and similarly for keywords.
Additionally, let's check if the string contains "
twice or '
twice instead of checking the first and last value.
If any of these conditions hold we can make a safe guess that the value doesn't need to be wrapped in quotes.
Your tests look great already. Let's add some more mixed case examples and examples where there is no space separating values.
@p0nch000 Thanks for the great work. Turns out values for |
Heyy took your advice i think is better now, lmk if it needs extra work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. Thanks!
thanks for the fast review and the great feedback again! I'll look for my next issue to work on @nmn |
* Correctly parse functions like counter, url, etc, added a unit test * Unit test for transform value features
* Correctly parse functions like counter, url, etc, added a unit test * Unit test for transform value features
Fix StyleX content property quotes handling
What changed / motivation
Updated
transformValue
function to correctly handle CSScontent
property values:Previously, StyleX incorrectly wrapped CSS functions like
counters()
in quotes, breaking their functionality.Linked PR/Issues
Fixes #771 - Don't wrap
content: counters(...)
in quotesAdditional Context
Test Coverage
Implementation Notes
Pre-flight checklist
Contribution Guidelines