Skip to content

Commit 0eda720

Browse files
author
Melanie Richards
committed
[css-color-4] Add new set of CSS system colors (addresses #3804)
1 parent 9f5facd commit 0eda720

File tree

1 file changed

+59
-28
lines changed

1 file changed

+59
-28
lines changed

css-color-4/Overview.bs

Lines changed: 59 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Representing sRGB Colors: the <<color>> type</h2>
129129
<dfn>&lt;color></dfn> = <<rgb()>> | <<rgba()>> | <<hsl()>> | <<hsla()>> |
130130
<<hwb()>> | <<gray()>> | <<device-cmyk()>> |
131131
<<hex-color>> | <<named-color>> | currentcolor |
132-
<<deprecated-system-color>>
132+
<<system-color>>
133133
</pre>
134134

135135
Some operations work differently on <dfn export>achromatic</dfn> colors.
@@ -209,7 +209,7 @@ Resolving Color values</h2>
209209

210210
<li>
211211
The computed value and used value of
212-
<a>named colors</a> (including <<deprecated-system-color>> colors),
212+
<a>named colors</a> (including <<system-color>> colors),
213213
3 and 6 digits <a>hex colors</a>,
214214
4 and 8 digits <a>hex colors</a> with an explicitly opaque alpha channel,
215215
comma separated ''rgb()'' colors without an alpha channel,
@@ -704,6 +704,57 @@ Named Colors</h2>
704704
Note: this list of colors and their definitions is a superset of the list of <a href="https://www.w3.org/TR/SVG/types.html#ColorKeywords">named colors defined by SVG 1.1</a>.
705705
For historical reasons, this is also referred to as the X11 color set.
706706

707+
708+
<h3 id="css-system-colors">
709+
CSS System Colors</h3>
710+
711+
In addition to being able to assign color keyword values to text, backgrounds, etc.,
712+
CSS defines a set of <dfn id="system-color" lt="system colors" export>&lt;system color></dfn> values,
713+
to allow authors to specify colors in a manner that integrate them into the user's graphic environment.
714+
715+
<<system-color>>s incur some privacy and security risk, as detailed in [[#priv-sec]].
716+
717+
For systems that do not have a corresponding value,
718+
the specified value should be mapped to the nearest system color value,
719+
or to a default color.
720+
Note that some profiles of CSS may not support System Colors at all.
721+
722+
The following lists the additional values for color-related CSS values and their general meaning.
723+
Any color property can take one of the following names.
724+
These names are case-insensitive and shown here with mixed capitalization for legibility.
725+
726+
<dl id="system-color-values" data-dfn-type="value" dfn-for="<system-color>" export>
727+
<dt><dfn>ActiveText</dfn>
728+
<dd>Text in active links.
729+
<dt><dfn>ButtonFace</dfn>
730+
<dd>The face background color for push buttons.
731+
<dt><dfn>ButtonText</dfn>
732+
<dd>Text on push buttons.
733+
<dt><dfn>Canvas</dfn>
734+
<dd>Background of application content or documents.
735+
<dt><dfn>Field</dfn>
736+
<dd>Background of input fields.
737+
<dt><dfn>FieldText</dfn>
738+
<dd>Text in input fields.
739+
<dt><dfn>GrayText</dfn>
740+
<dd>Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.
741+
<dt><dfn>Highlight</dfn>
742+
<dd>Background of item(s) selected in a control.
743+
<dt><dfn>HighlightText</dfn>
744+
<dd>Text of item(s) selected in a control.
745+
<dt><dfn>LinkText</dfn>
746+
<dd>Text in non-active, non-visited links.
747+
<dt><dfn>Text</dfn>
748+
<dd>Text in application content or documents.
749+
<dt><dfn>VisitedText</dfn>
750+
<dd>Text in visited links.
751+
</dl>
752+
753+
Earlier versions of CSS defined additional <<system color>>s,
754+
which have since been deprecated.
755+
These are documented in [[#deprecated-system-colors]].
756+
757+
707758
<h3 id='transparent-color'>
708759
The ''transparent'' keyword</h3>
709760

@@ -2759,12 +2810,10 @@ Default Style Rules</h2>
27592810

27602811
</pre>
27612812

2762-
<h2 id="system-colors" class="no-num">
2813+
<h2 id="deprecated-system-colors" class="no-num">
27632814
Appendix A: Deprecated CSS System Colors</h2>
27642815

2765-
Earlier versions of CSS defined several additional named color keywords,
2766-
the <dfn>&lt;deprecated-system-color></dfn>s,
2767-
which were meant to take their value from operating system themes.
2816+
Earlier versions of CSS defined several additional <<system-color>>s.
27682817
These color names have been <strong>deprecated</strong>, however,
27692818
as they are insufficient for their original purpose
27702819
(making website elements look like their native OS counterparts),
@@ -2790,10 +2839,6 @@ Appendix A: Deprecated CSS System Colors</h2>
27902839
<dt><dfn>Background</dfn>
27912840
<dd>Desktop background.
27922841

2793-
<dt><dfn>ButtonFace</dfn>
2794-
<dd>The face background color for 3-D elements that appear 3-D due to
2795-
one layer of surrounding border.
2796-
27972842
<dt><dfn>ButtonHighlight</dfn>
27982843
<dd>The color of the border facing the light source for 3-D elements
27992844
that appear 3-D due to one layer of surrounding border.
@@ -2802,22 +2847,9 @@ Appendix A: Deprecated CSS System Colors</h2>
28022847
<dd>The color of the border away from the light source for 3-D elements
28032848
that appear 3-D due to one layer of surrounding border.
28042849

2805-
<dt><dfn>ButtonText</dfn>
2806-
<dd>Text on push buttons.
2807-
28082850
<dt><dfn>CaptionText</dfn>
28092851
<dd>Text in caption, size box, and scrollbar arrow box.
28102852

2811-
<dt><dfn>GrayText</dfn>
2812-
<dd>Grayed (disabled) text. This color is set to #000 if
2813-
the current display driver does not support a solid gray color.
2814-
2815-
<dt><dfn>Highlight</dfn>
2816-
<dd>Item(s) selected in a control.
2817-
2818-
<dt><dfn>HighlightText</dfn>
2819-
<dd>Text of item(s) selected in a control.
2820-
28212853
<dt><dfn>InactiveBorder</dfn>
28222854
<dd>Inactive window border.
28232855

@@ -2891,6 +2923,7 @@ Changes</h2>
28912923
<h3 id="changes-from-20160705" class='no-num'>Changes since <a href="http://www.w3.org/TR/2016/WD-css-color-4-20160705/">Working Draft of 05 July 2016</a></h3>
28922924

28932925
<ul>
2926+
<li>Add new list of CSS system colors</li>
28942927
<li>Initial value of the "color" property is now black</li>
28952928
<li>Clarify hue in LCH is modulo 360deg</li>
28962929
<li>Clarify allowed range of L in LCH and Lab, and meaning of L=100</li>
@@ -2968,13 +3001,11 @@ Security and Privacy Considerations {#priv-sec}
29683001
This specification defines "system" colors,
29693002
which theoretically can expose details of the user's OS settings,
29703003
which is a fingerprinting risk.
2971-
However, these values are now defined to be settings-neutral,
2972-
and should be implemented in a generic way that does not actually expose system colors.
29733004

29743005
The system colors,
29753006
if they actually correspond to the user's system colors,
29763007
also pose a security risk,
29773008
as they make it easier for a malware site
2978-
to create a dialog that appears to be a system dialog.
2979-
However, as they are now defined to be "generic",
2980-
this risk should be eliminated.
3009+
to create user interfaces that appear to be from the system.
3010+
However, as several system colors are now defined to be "generic",
3011+
this risk should be mitigated.

0 commit comments

Comments
 (0)