css-to-react-native
css-to-react-native copied to clipboard
No support for `currentcolor`
I was wondering if adding an extra check for node.value === 'currentcolor' would cause large issues in the matchColor function.
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
@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! :)