Repository navigation
Open
Labels
investigation-effort-proposalInvestigation Effort Proposal
Description
Description
I propose an investigation of CSS element() which lets a page use the appearance of one element as an image elsewhere on the same page. The first target would be backgrounds that follow changes to their source, such as a small page preview or a canvas used in several places.
The investigation would establish a useful, clearly specified subset and build tests that browser teams can share. It would cover simple sources, live updates, image size, missing references, and reference loops.
Specification and existing tests
- CSS Images Level 4: element().
- Existing CSS Images WPT source and results.
- Earlier Interop proposal #442. Its rejection cited missing WPT, and follow-up guidance suggested a dedicated
css/css-images/element/directory.
The current directory listing has no dedicated element/ suite. The first task would include checking for relevant tests elsewhere before adding new ones.
Rationale
Reasons for including the feature
There are concrete examples of developers using this kind of visual reuse:
- A page minimap. The earlier proposal discussion reports its use on Stefan Judis's site.
- Canvas output used as CSS images. The CSS Paint polyfill README documents using
-moz-element()and-webkit-canvas()in some browsers, with canvas encoding throughtoDataURL()ortoBlob()in others. That is a concrete example of a library needing different paths for similar work. - Developer interest. Comments on the earlier proposal express interest in the feature. This is useful qualitative evidence, but it is not a representative survey or a usage estimate.
- A known test gap. The 2024 rejection identifies an actionable obstacle. An investigation can address that obstacle with a small, reviewed suite instead of repeating a broad implementation request.
Reacted by Bramus, John P. Green, firefoxic, phantomxx29474, Ana Tudor, Luke Warlow, Agustin Capeletto, Josh Collinsworth, Matías Juarez, Hardi Kõvamees and 14 more
Metadata
Metadata
Assignees
Labels
investigation-effort-proposalInvestigation Effort Proposal
Type
Projects
- StatusShow more project fieldsTodo
Activity
thebabydino commentedon Sep 24, 2026
The below is an example of something that's not possible without it. This is almost pure CSS with the except of the alpha fade grain effect, which uses a super simple SVG
filter.Opisek commentedon Nov 15, 2026
Chiming in to say I would absolutely love this feature for providing previews of elements in other parts of the website.
I have already written a more detailed report of my testing with the experimental version of this feature in Firefox:
web-platform-dx/developer-signals#297
One issue I'd like to bring up (already described in the link above) is that there is no native CSS way to mirror the width and height of the referenced element, so if you want a "copy" of another part of DOM to have the same size, you either have to hard-code the values or use JavaScript.