From 4fc9857d31605533c5a92c9d6d1f76bda0b31cb9 Mon Sep 17 00:00:00 2001 From: Melanie Richards Date: Fri, 5 Jul 2019 12:13:19 -0700 Subject: [PATCH] [css-color-4] Add new set of CSS system colors (addresses #3804) --- css-color-4/Overview.bs | 106 +++++++++++++++++++++++++++------------- 1 file changed, 73 insertions(+), 33 deletions(-) diff --git a/css-color-4/Overview.bs b/css-color-4/Overview.bs index 41f7a1ef80e..b40e5e41102 100644 --- a/css-color-4/Overview.bs +++ b/css-color-4/Overview.bs @@ -129,7 +129,7 @@ Representing sRGB Colors: the <> type <color> = <> | <> | <> | <> | <> | <> | <> | <> | <> | currentcolor | - <> + <> Some operations work differently on achromatic colors. @@ -209,7 +209,7 @@ Resolving Color values
  • The computed value and used value of - named colors (including <> colors), + named colors (including <> colors), 3 and 6 digits hex colors, 4 and 8 digits hex colors with an explicitly opaque alpha channel, comma separated ''rgb()'' colors without an alpha channel, @@ -366,11 +366,18 @@ The RGB hexadecimal notations: ''#RRGGBB'' -

    -Named Colors

    +

    +Color Keywords

    In addition to the various numeric syntaxes for <>s, - CSS defines a large set of named colors that can be used instead, + CSS defines several sets of color keywords that can be used instead— + each with their own advantages or use cases. + + +

    +Named Colors

    + + CSS defines a large set of named colors, so that common colors can be written and read more easily. A <named-color> is written as an <>, accepted anywhere a <> is. @@ -704,6 +711,57 @@ Named Colors Note: this list of colors and their definitions is a superset of the list of named colors defined by SVG 1.1. For historical reasons, this is also referred to as the X11 color set. + +

    +CSS System Colors

    + + In addition to being able to assign color keyword values to text, backgrounds, etc., + CSS defines a set of <system-color> values, + to allow authors to specify colors in a manner that integrate them into the user's graphic environment. + + <>s incur some privacy and security risk, as detailed in [[#priv-sec]]. + + For systems that do not have a corresponding value, + the specified value should be mapped to the nearest system color value, + or to a default color. + Note that some profiles of CSS may not support System Colors at all. + + The following lists the additional values for color-related CSS values and their general meaning. + Any color property can take one of the following names. + These names are case-insensitive and shown here with mixed capitalization for legibility. + +
    +
    ActiveText +
    Text in active links. +
    ButtonFace +
    The face background color for push buttons. +
    ButtonText +
    Text on push buttons. +
    Canvas +
    Background of application content or documents. +
    Field +
    Background of input fields. +
    FieldText +
    Text in input fields. +
    GrayText +
    Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color. +
    Highlight +
    Background of item(s) selected in a control. +
    HighlightText +
    Text of item(s) selected in a control. +
    LinkText +
    Text in non-active, non-visited links. +
    Text +
    Text in application content or documents. +
    VisitedText +
    Text in visited links. +
    + + Earlier versions of CSS defined additional <>s, + which have since been deprecated. + These are documented in [[#deprecated-system-colors]]. + +

    The ''transparent'' keyword

    @@ -2759,12 +2817,10 @@ Default Style Rules -

    +

    Appendix A: Deprecated CSS System Colors

    - Earlier versions of CSS defined several additional named color keywords, - the <deprecated-system-color>s, - which were meant to take their value from operating system themes. + Earlier versions of CSS defined several additional <>s. These color names have been deprecated, however, as they are insufficient for their original purpose (making website elements look like their native OS counterparts), @@ -2790,10 +2846,6 @@ Appendix A: Deprecated CSS System Colors
    Background
    Desktop background. -
    ButtonFace -
    The face background color for 3-D elements that appear 3-D due to - one layer of surrounding border. -
    ButtonHighlight
    The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border. @@ -2802,22 +2854,9 @@ Appendix A: Deprecated CSS System Colors
    The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border. -
    ButtonText -
    Text on push buttons. -
    CaptionText
    Text in caption, size box, and scrollbar arrow box. -
    GrayText -
    Grayed (disabled) text. This color is set to #000 if - the current display driver does not support a solid gray color. - -
    Highlight -
    Item(s) selected in a control. - -
    HighlightText -
    Text of item(s) selected in a control. -
    InactiveBorder
    Inactive window border. @@ -2880,8 +2919,10 @@ Appendix A: Deprecated CSS System Colors

    Acknowledgments

    -Thanks to Brad Pettit both for writing up color-profiles, and for implementing it. Thanks to Steven Pemberton for his write up on HSL colors. - Thanks especially to the feedback from Marc Attinasi, Bert Bos, Joe Clark, fantasai, Patrick Garies, Tony Graham, Ian Hickson, Susan Lesch, Alex LeDonne, Cameron McCormack, Krzysztof Maczyński, Chris Moschini, Chris Murphy, Christoph Päper, David Perrell, Jacob Refstrup, Dave Singer, Jonathan Stanley, Andrew Thompson, Russ Weakley, Etan Wexler, David Woolley, Boris Zbarsky, Steve Zilles, the XSL FO subgroup of the XSL working group, and all the rest of the www-style community. +Thanks to Brad Pettit both for writing up color-profiles, and for implementing it. +Thanks to Steven Pemberton for his write-up on HSL colors. +Thanks to Melanie Richards for updating the system colors write-up. +Thanks especially to the feedback from Marc Attinasi, Bert Bos, Joe Clark, fantasai, Patrick Garies, Tony Graham, Ian Hickson, Susan Lesch, Alex LeDonne, Cameron McCormack, Krzysztof Maczyński, Chris Moschini, Chris Murphy, Christoph Päper, David Perrell, Jacob Refstrup, Dave Singer, Jonathan Stanley, Andrew Thompson, Russ Weakley, Etan Wexler, David Woolley, Boris Zbarsky, Steve Zilles, the XSL FO subgroup of the XSL working group, and all the rest of the www-style community. And thanks to Chris Lilley for being the resident CSS Color expert. @@ -2891,6 +2932,7 @@ Changes

    Changes since Working Draft of 05 July 2016

      +
    • Add new list of CSS system colors
    • Initial value of the "color" property is now black
    • Clarify hue in LCH is modulo 360deg
    • Clarify allowed range of L in LCH and Lab, and meaning of L=100
    • @@ -2968,13 +3010,11 @@ Security and Privacy Considerations {#priv-sec} This specification defines "system" colors, which theoretically can expose details of the user's OS settings, which is a fingerprinting risk. -However, these values are now defined to be settings-neutral, -and should be implemented in a generic way that does not actually expose system colors. The system colors, if they actually correspond to the user's system colors, also pose a security risk, as they make it easier for a malware site -to create a dialog that appears to be a system dialog. -However, as they are now defined to be "generic", -this risk should be eliminated. +to create user interfaces that appear to be from the system. +However, as several system colors are now defined to be "generic", +this risk should be mitigated. \ No newline at end of file