Re: [css-houdini-drafts] [css-paint-api] Current Color in context (#921)

If your paint module code specifically wants the current color (ie, to _always_ match current color), you can declare a dependency on the `color` property via the [`inputProperties` getter](https://drafts.css-houdini.org/css-paint-api/#paint-definition-input-properties).

However, it gets more complicated if your module is dependent on another color input (a parameter, custom property, or another property like `border-color`) & the website CSS uses `currentColor` as the input value.  Since `currentColor` is a valid computed value, that styleMap that gets passed to your paint code will only have the keyword, instead of the final used color.

If you try to use the keyword directly in your painting code, it's currently [specified to behave as solid black](https://drafts.css-houdini.org/css-paint-api/#paint-definition-input-properties). Which is surely not what you intended when you passed `currentColor` as a parameter to your paint function.

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/921#issuecomment-513837859 using your GitHub account

Received on Monday, 22 July 2019 15:20:32 UTC