From cf222a32f3ffba0513a3f5dde1acd2a3ede794e1 Mon Sep 17 00:00:00 2001
From: Theresa O'Connor http-equiv
content
charset
media
The media
attribute
+ says which media the metadata applies to. The value must be a valid media query list.
+ Unless the name
is theme-color
, the media
+ attribute has no effect on the processing model and must not be used by authors.
The name
and
- content
IDL
- attributes must reflect the respective content attributes of the same name. The IDL
- attribute httpEquiv
must reflect the content attribute
- http-equiv
.
The name
, content
, and media
IDL attributes
+ must reflect the respective content attributes of the same name. The IDL attribute
+ httpEquiv
must
+ reflect the content attribute http-equiv
.
There must not be more than one meta
element with its name
attribute value set to an
- ASCII case-insensitive match for theme-color
per document.
Within an HTML document, the media
attribute value must
+ be unique amongst all the meta
elements with their name
attribute value set to an ASCII
+ case-insensitive match for theme-color
.
The media
attribute may be used to describe the context
+ in which the provided color should be used.
If we only wanted to use "WHATWG green" as this standard's theme color in dark mode,
+ we could use the prefers-color-scheme
media feature:
<!DOCTYPE HTML>
+<title>HTML Standard</title>
+<meta name="theme-color" content="#3c790a" media="(prefers-color-scheme: dark)">
+...
+ To obtain a page's theme color, user agents must run the following steps:
@@ -14404,6 +14426,11 @@ interface HTMLMetaElement : HTMLElement {For each element in candidate elements:
If element has a media
attribute
+ and the value of element's media
+ attribute does not match the environment, then
+ continue.
Let value be the result of stripping leading and trailing ASCII whitespace from the value of
element's content
attribute.
If any meta
elements are inserted into the document or removed from the document, or existing meta
elements have their
- name
or content
- attributes changed, user agents must re-run the above algorithm and apply the result to any
+ name
, content
, or
+ media
attributes changed, or if the environment changes
+ such that any meta
element's media
+ attribute's value may now or may no longer match the
+ environment, user agents must re-run the above algorithm and apply the result to any
affected UI.
name
;
http-equiv
;
content
;
- charset
+ charset
;
+ media
HTMLMetaElement
media
link
;
+ meta
;
source
(in picture
);
style