Re: [csswg-drafts] [css-color-adjust-1] Spec currently breaks use of currentColor for SVG icons in WHCM (#6310)

Reflagging for the agenda, because I don't think we quite got this situation correct.

Consider an SVG where the author has set 'color' to an explicit value on the `<SVG>` element and is using ''currentColor'' throughout to reference that color. This isn't the case we're trying to solve here: the SVG is not trying to inherit the color from the context. They're using an explicit color, likely in coordination with other colors, and using 'color' as a convenient variable. If we apply forced-colors only to 'color' in this case, and not to the rest of the colors in the SVG, we might end up breaking the SVG.

So to target just the case we need to address (icons wanting to inherit the surrounding context's text color) I think what we really want to do is limit the forced-color application to when 'color' is inherited from the SVG's context, and not to the use of the 'color' property in general. Something like:

> preserve-parent-color
>   If the 'color' property’s [=specified value=] is ''currentColor'',
>   then it [=computed value|computes=] to the used color of its parent’s 'color' value.
>   In all other respects, behaves the same as ''none''.


-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6310#issuecomment-858112357 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 9 June 2021 21:24:30 UTC