You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: css-color-4/Overview.bs
+84-15
Original file line number
Diff line number
Diff line change
@@ -576,7 +576,7 @@ The RGB hexadecimal notations: ''#RRGGBB''</h3>
576
576
The alpha channel of the color is fully opaque.
577
577
578
578
<div class='example'>
579
-
In other words, ''#00ff00'' represents the same color as ''rgb(0 255 0)'' (a lime green).
579
+
In other words, <span class="swatch" style="--color: #00ff00"></span>''#00ff00'' represents the same color as<span class="swatch" style="--color: #00ff00"></span>''rgb(0 255 0)'' (a lime green).
580
580
</div>
581
581
582
582
<dt>8 digits
@@ -588,7 +588,7 @@ The RGB hexadecimal notations: ''#RRGGBB''</h3>
588
588
and ''ff'' represent a fully opaque color.
589
589
590
590
<div class='example'>
591
-
In other words, ''#0000ffcc'' represents the same color as ''rgb(0 0 100% / 80%)'' (a slightly-transparent blue).
591
+
In other words, <span class="swatch" style="--color: #0000ffcc"></span>''#0000ffcc'' represents the same color as<span class="swatch" style="--color: #0000ffcc"></span>''rgb(0 0 100% / 80%)'' (a slightly-transparent blue).
592
592
</div>
593
593
594
594
<dt>3 digits
@@ -604,7 +604,7 @@ The RGB hexadecimal notations: ''#RRGGBB''</h3>
604
604
605
605
<div class='example'>
606
606
This syntax is often explained by saying that it's identical to a 6-digit notation obtained by "duplicating" all of the digits.
607
-
For example, the notation ''#123'' specifies the same color as the notation ''#112233''.
607
+
For example, the notation <span class="swatch" style="--color: #123"></span>''#123'' specifies the same color as the notation<span class="swatch" style="--color: #123"></span>''#112233''.
608
608
This method of specifying a color has lower "resolution" than the 6-digit notation;
609
609
there are only 4096 possible colors expressible in the 3-digit hex syntax,
610
610
as opposed to approximately 17 million in 6-digit hex syntax.
@@ -975,18 +975,18 @@ System Colors</h3>
975
975
976
976
In general, the <<system-color>> keywords
977
977
reflect <em>default</em> color choices made by the user, the browser, or the OS.
978
-
They are typically used in the brwser default stylesheet, for this reason.
978
+
They are typically used in the browser default stylesheet, for this reason.
979
979
980
980
To maintain legibility,
981
981
the <<system-color>> keywords also respond to light mode or dark mode changes.
982
982
983
983
984
984
<div class="example" id="LM-DM-links">
985
-
For example, traditional bluelink text is legible on a white background
985
+
For example, traditional <span class="swatch" style="--color: blue"></span> blue link text is legible on a<span class="swatch" style="--color: #fff"></span> white background
986
986
(WCAG contrast 8.59:1, AAA pass)
987
-
but would not be legible on a black background
987
+
but would not be legible on a <span class="swatch" style="--color: #000"></span>black background
988
988
(WCAG contrast 2.44:1, AA fail).
989
-
Instead, a lighter blue such as #81D9FE would be used in dark mode
989
+
Instead, a lighter blue such as <span class="swatch" style="--color: #81D9FE"></span>#81D9FE would be used in dark mode
0 commit comments