css-to-react-native icon indicating copy to clipboard operation
css-to-react-native copied to clipboard

No support for `currentcolor`

Open iteratetograceness opened this issue 3 years ago • 2 comments

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

iteratetograceness avatar Oct 17 '22 03:10 iteratetograceness

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 avatar Oct 17 '22 10:10 jacobp100

@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! :)

iteratetograceness avatar Oct 17 '22 13:10 iteratetograceness