Skip to content
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

No support for currentcolor #170

Open
iteratetograceness opened this issue Oct 17, 2022 · 2 comments
Open

No support for currentcolor #170

iteratetograceness opened this issue Oct 17, 2022 · 2 comments

Comments

@iteratetograceness
Copy link

I was wondering if adding an extra check for node.value === 'currentcolor' would cause large issues in the matchColor function.

@jacobp100 jacobp100 reopened this Oct 17, 2022
@jacobp100
Copy link
Contributor

jacobp100 commented Oct 17, 2022

Sorry - I misunderstood this request. I can only think of one use-case that would actually work, if you have Text container B nested in Text container A, if B had a colour set by default and you wanted to unset it and inherit the text colour, you could use color: currentColor, and we'd output { color: undefined } to achieve that

However, at the same time, I think people would expect this to work across the board - i.e. borders, backgrounds, non-text elements etc. and that's not possible without layering a more sophisticated CSS runtime, which is explicitly out of scope for this library

I'll leave this open because we technically can achieve some of this request - but I'm undecided if we should

@iteratetograceness
Copy link
Author

@jacobp100 no worries, I definitely could've provided more context! And yes, instead of throwing an error when the value is currentColor, I like the idea of outputing something like { color: undefined } to give developers flexibility to handle currentColor on top of css-to-react-native. I'll check in here and there in case you land on an approach you feel good about! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants