-
Notifications
You must be signed in to change notification settings - Fork 83
Support CSS3 Variables in font family #91
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
Support CSS3 Variables in font family #91
Conversation
Pinging @kristerkari 😁 |
Thanks @birkir! I had a discussion with @jacobp100 about adding support for CSS variables in a previous pull request. There is one thing that makes supporting CSS variables tricky: a CSS variable can have so called complex values (contain multiple values): That means that supporting longhand properties (such as I'm not sure what the plan is for this parser when it comes to supporting CSS variables as it can not support shorthand properties because of the possible complex values (@jacobp100 is the right person to answer that). What I was thinking of is that I could change my own parser css-to-react-native-transform to parse any values that have |
Oh yeah, sounds good. However the parser doesn't follow any CSS Spec strictly in general so I don't feel like loosly detect css variables and passing them down as-is is necesserily a bad thing. Thanks @kristerkari, let me know if you need help! |
Also, @jacobp100 mentioned that his own library has support for CSS variables when used with React Native. I'm not sure how it's implemented as I haven't looked into it yet: |
True, but this is more a question of does it make sense to add support for something if it can not be fully supported. People who are just writing CSS in React Native without knowing anything about the parser might not expect something to be only partly implemented. What I see more likely (just my opinion) that
|
cssta pre-evaluates I think adding them to this parser opens a can of worms, because one |
That's a quite nice way to handle it. You can still get the same end result as you would without using CSS vars. |
Currently failing when doing something like:
This PR fixes that, see the tests.