CSS Linked Parameters for External SVGs
- Category
- Miscellaneous
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
WPT details: Some WPT coverage already exists. Additional WPTs will be added as the Chromium implementation proceeds. https://wpt.fyi/results/css/css-link-params https://wpt.fyi/results/svg/styling/css-linked-parameters
Summary
External SVGs referenced by an element or a CSS image property cannot be styled by the page that references them. CSS Linked Parameters lets a page pass named CSS values into such an SVG, so one cached file can be reused with different themes. Parameters are declared with 'param(<dashed-ident>, <declaration-value>?)' and supplied through either the new link-parameters CSS property, a link parameter directive in the URL, or a param() modifier in url(). The SVG reads each one as a custom environment variable through env(), which also provides a fallback when no value is passed. For example, the page writes: img { link-parameters: param(--color, green); } and the SVG writes: circle { fill: env(--color, black); } The circle is green when the page supplies --color, and black otherwise.
Motivation
External SVGs loaded by an element or referenced through a CSS image property cannot be styled by the page that references them, so adapting an icon to a site's theme is difficult. Developers work around this by inlining the SVG, which bloats the document and prevents independent caching. Another developer workaround creates a copy of the file per theme variant, which duplicates assets and cache entries for what is logically one image. Yet another developer workaround fetches and rewrites the SVG using JavaScript, which adds complexity and can be blocked by CSP. CSS Linked Parameters address these gaps: a single cached SVG file renders differently at each reference, driven by parameters the page provides.
Standards & signals
- Specification: https://drafts.csswg.org/css-link-params
- Firefox: Shipped/Shipping — Firefox has implemented the 'link-parameters' property for external SVG image rendering. It is enabled in Firefox Nightly starting with Firefox 153, as tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=2046153. The two URL-based mechanisms remain follow-up work.
- Safari: No signal
- Web developers: Positive — State of CSS 2025 identifies SVG issues as the second most common shapes and graphics pain point, with styling and coloring external SVGs as the leading theme.
- Tracking bug: https://issues.chromium.org/issues/41482962
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=css%2Fcss-link-params
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+CSS%20Linked%20Parameters%20for%20External%20SVGs
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=CSS%20Linked%20Parameters%20for%20External%20SVGs
- Baseline status: https://webstatus.dev/?q=CSS%20Linked%20Parameters%20for%20External%20SVGs
Explainers: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/SVG/CSSLinkedParameters/explainer.md