Re: [csswg-drafts] [css-images?] Let’s fix icons on the Web! Aka a way to pass currentColor and other context to linked SVGs (#9872)

> 2. Tab’s more recent [SVG Params](https://tabatkins.github.io/specs/svg-params/#setting-url) based on custom properties

Just to note, [CSS Linked Parameters](https://drafts.csswg.org/css-link-params-1/) is already on the standards track.

I do like the proposal and agree with @tabatkins' idea of incorporating this into the existing syntax. So this would then look like

```css
content: src("icon.svg", param(currentcolor))
```

> > 2. There should be a way to trigger this via url as well, so you can use it in `<img src="icon.svg">`.
> 
> Agreed but this seems like a whole different feature (and far more complicated to define in a way that doesn't clash with existing params).

The spec. already describes a way to do that for custom properties. Based on that, this would be expressible via

```html
<img src="icon.svg#param(currentcolor)" alt="">
```

> The main motivation for this proposal was for it to be a quick win, something that can be implemented more easily than the full-blown params proposal.
> As long as tying it to the params proposal doesn't negate that, I think it’s a good idea to integrate them more closely to avoid the cognitive overhead on users of having to learn two distinct syntaxes for highly related things.

While reusing the same function, implementers could still add them independently from the custom properties syntax.

Sebastian

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


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

Received on Sunday, 28 January 2024 20:26:57 UTC