Skip to content

CSS Linked Parameters for SVG #1346

Open

Description

@o-t-w

Description

Linked parameters provides three ways for developers to style SVG images.

img {
    link-parameters: param(--color, blue);
}
<img src="example.svg#:~:param(--color,blue)">
.icon {
  background-image: url("example.svg", param(--color, blue));
}

Specification

https://drafts.csswg.org/css-link-params/

web-feature

web-features: link-parameters
https://web-platform-dx.github.io/web-features-explorer/features/link-parameters/

Test Links

https://wpt.fyi/results/svg/styling/css-linked-parameters?label=experimental&label=master&aligned

Additional Signals

This feature received 40 👍 in last years Interop.
Developer Signals entry
The Chromium issue has 17 +1s.
This Tweet about the feature received 111 likes.
This Bluesky post about the feature received 134 likes.
Implementation work in Firefox is ongoing.

In the 2025 State of HTML survey, SVG came second in the Graphics & Multimedia Pain Points chart. In the comments, certain issues were voiced repeatedly:

  • "No way to pass currentColor and other params to remote SVGs makes icons very hard to manage"
  • "I'd like to refer to an SVG (e.g. to use as a repeated icon) that's less verbose than <svg><use>...</use></svg>"
  • “Want to be able to do <img src='file.svg'> and still retain ability to style. Currently if i want to pass through currentColor for example i have to inline the entire icon which is silly if i'm using it in dozens of places"
  • "Inlining SVGs causes a lot of repetition and noise in the HTML"

Currently developers are using unfortunate workarounds such as mask-image.
The <use> element provides something of a solution but is more complex and verbose than an <img>. <use> elements are stripped out by the Web Sanitizer.

Activity

  1. github-actions commented on Sep 3, 2026

    @github-actions

    This comment was automatically generated based on the information you provided. Please don't edit it.

    Below is additional information about the web feature (from the web-features project) which is referenced in your proposal.
    If this doesn't accurately correspond to your proposal, please update your initial comment to include web-features: <feature-id>.
    To find feature IDs, use the web-features explorer.

    Feature Link parameters

    • ID: link-parameters
    • Name: Link parameters
    • Description: The link-parameters CSS property, param() modifier for the url() CSS function, and the #:~:param(…) URL fragment set custom CSS environment variables on an external resource, such as an SVG image, allowing the external resource to adapt its presentation based on the variables.
    • Baseline status: Limited Availability
    • Docs: link-parameters CSS property, param() CSS function
    • Developer signals: 34 votes / 3 use cases (details)
    • More information: See the web-features explorer
  2. LeaVerou commented on Sep 10, 2026

    @LeaVerou
    Member
  3. svgeesus commented on Sep 13, 2026

    @svgeesus

    @o-t-w Looks like the github bot needs the literal string "Link parameters" to be edited into the original post, not the link to the feature.

  4. phantomxx29474 commented on Oct 9, 2026

    @phantomxx29474

    Safari is gonna join us. Starting from Safari TP 254

    https://webkit.org/blog/18420/release-notes-for-safari-technology-preview-254/

    Oh, and Chrome is prototyping the feature.

    https://groups.google.com/a/chromium.org/g/blink-dev/c/8FpImg92-4s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions