Support user theme preference when constructing favicons dynamically by allowing the media
metadata field
#78016
jimCresswell
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Enable the dynamic construction of
link
elements like like<link rel="icon" href="/icon-512-dark?abc123" media="(prefers-color-scheme: dark)">
fromapp/icon.tsx
files, so that the browser can choose appropriate favicon images depending on user preference. At the moment themedia
metadata is stripped out when callinggenerateImageData
, which makes sense, but in this respect a favicon has additional metadata to a standard image.Non-Goals
media
metadata for images in general, just for faviconsBackground
It's needed for accessibility, and to support a standard browser mechanism that people already use.
Proposal
Create a new metadata subclass
generateIconMetadata
that supports all of thelink
,rel=icon
metadata fields.I can contribute.
Beta Was this translation helpful? Give feedback.
All reactions