Skip to content

Commit f8393c1

Browse files
committed
[css-color-4] Rewrite intro to non-deprecated system colors to center their use around forced-colors mode rather than generic use.
1 parent 0a47e6f commit f8393c1

File tree

2 files changed

+54
-26
lines changed

2 files changed

+54
-26
lines changed

css-color-4/Overview.bs

Lines changed: 53 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -715,57 +715,85 @@ For historical reasons, this is also referred to as the X11 color set.
715715
<h3 id="css-system-colors">
716716
CSS System Colors</h3>
717717

718-
In addition to being able to assign color keyword values to text, backgrounds, etc.,
719-
CSS defines a set of <dfn>&lt;system-color></dfn> values,
720-
to allow authors to specify colors in a manner that integrate them into the user's graphic environment.
721-
722-
<<system-color>>s incur some privacy and security risk, as detailed in [[#priv-sec]].
723-
724-
For systems that do not have a corresponding value,
725-
the specified value should be mapped to the nearest system color value,
726-
or to a default color.
727-
Note that some profiles of CSS may not support System Colors at all.
728-
729-
The following lists the additional values for color-related CSS values and their general meaning.
730-
Any color property can take one of the following names.
731-
These names are case-insensitive and shown here with mixed capitalization for legibility.
718+
In [=forced colors mode=],
719+
most colors on the page are forced into a restricted, user-chosen palette.
720+
The <dfn>&lt;system-color></dfn> keywords
721+
expose these user-chosen colors
722+
so that the rest of the page can integrate with this restricted palette.
723+
724+
When the 'forced-colors' [=media feature=] is ''forced-colors/active'',
725+
authors <em>should</em> use the <<system-color>> keywords as color values
726+
in properties other than those listed in [[css-color-adjust-1#forced-colors-properties]],
727+
to ensure legibility and consistency across the page
728+
and avoid an uncoordinated mishmash of user-forced and page-chosen colors.
729+
730+
Authors <em>may</em> also use these keywords at any time,
731+
but <em>should</em> be careful to use the colors
732+
in <a href="#system-color-pairs">matching background-foreground pairs</a>
733+
to ensure appropriate contrast,
734+
as any particular contrast relationship across non-matching pairs
735+
(e.g. ''Canvas'' and ''ButtonText'')
736+
is not guaranteed.
737+
738+
The <<system-color>> keywords are defined as follows:
732739

733740
<dl id="system-color-values" data-dfn-type="value" dfn-for="<system-color>">
734741
<dt><dfn>Canvas</dfn>
735742
<dd>Background of application content or documents.
736743
<dt><dfn>Text</dfn>
737744
<dd>Text in application content or documents.
738-
739-
<dt><dfn>HighlightText</dfn>
740-
<dd>Text of item(s) selected in a control.
741-
<dt><dfn>Highlight</dfn>
742-
<dd>Background of item(s) selected in a control.
743-
744745
<dt><dfn>LinkText</dfn>
745746
<dd>Text in non-active, non-visited links.
746747
<dt><dfn>VisitedText</dfn>
747748
<dd>Text in visited links.
748749
<dt><dfn>ActiveText</dfn>
749750
<dd>Text in active links.
750751

752+
<dt><dfn>ButtonFace</dfn>
753+
<dd>The face background color for push buttons.
754+
<dt><dfn>ButtonText</dfn>
755+
<dd>Text on push buttons.
756+
751757
<dt><dfn>Field</dfn>
752758
<dd>Background of input fields.
753759
<dt><dfn>FieldText</dfn>
754760
<dd>Text in input fields.
755761

756-
<dt><dfn>ButtonFace</dfn>
757-
<dd>The face background color for push buttons.
758-
<dt><dfn>ButtonText</dfn>
759-
<dd>Text on push buttons.
762+
<dt><dfn>Highlight</dfn>
763+
<dd>Background of item(s) selected in a control.
764+
<dt><dfn>HighlightText</dfn>
765+
<dd>Text of item(s) selected in a control.
760766

761767
<dt><dfn>GrayText</dfn>
762-
<dd>Disabled text. (Often, but not necessarily, gray.)
768+
<dd>Disabled text.
769+
(Often, but not necessarily, gray.)
763770
</dl>
764771

772+
Note: As with all other [=CSS/keywords=],
773+
these names are case-insensitive.
774+
They are shown here with mixed capitalization for legibility.
775+
776+
For systems that do not have a particular system UI concept,
777+
the specified value should be mapped to
778+
the most closely related system color value that exists.
779+
The following pairings are expected to form legible background-foreground colors:
780+
781+
<ul id=system-color-pairs>
782+
* ''Canvas'' background with ''Text'', ''LinkText'', ''VisitedText'', ''ActiveText'' foreground.
783+
* ''ButtonFace'' background with ''ButtonText'' foreground.
784+
* ''Field'' background with ''FieldText'' foreground.
785+
* ''Highlight'' background with ''HighlightText'' foreground.
786+
</ul>
787+
788+
Additionally, ''GrayText'' is expected to be readable,
789+
though possibly at a lower contrast rating,
790+
over any of the backgrounds.
791+
765792
Earlier versions of CSS defined additional <<system-color>>s,
766793
which have since been deprecated.
767794
These are documented in [[#deprecated-system-colors]].
768795

796+
Note: The <<system-color>>s incur some privacy and security risk, as detailed in [[#priv-sec]].
769797

770798
<h3 id='transparent-color'>
771799
The ''transparent'' keyword</h3>

css-values-4/Overview.bs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ Textual Data Types</h2>
489489
Pre-defined Keywords</h3>
490490

491491
In the value definition fields,
492-
<dfn lt="keyword" export>keywords</dfn> with a pre-defined meaning appear literally.
492+
<dfn lt="keyword" export for=CSS>keywords</dfn> with a pre-defined meaning appear literally.
493493
Keywords are <a>CSS identifiers</a>
494494
and are interpreted <a lt="ASCII case-insensitive">ASCII case-insensitively</a>
495495
(i.e., [a-z] and \[A-Z] are equivalent).

0 commit comments

Comments
 (0)