Skip to content

[css-color] Resolution of system colors is defined in 2 places #13450

Closed

Description

@Loirooriol

Activity

  1. svgeesus commented on Feb 4, 2026

    @svgeesus
    Collaborator

    Whoops!

  2. self-assigned this
    on Feb 4, 2026
  3. svgeesus commented on Feb 5, 2026

    @svgeesus
    Collaborator

    @Loirooriol so those two definintions are mostly the same, except that the first one has some language about calc() (which does not apply to system and deprecated colors, and the second one adds

    However, such colors must not be altered by 'forced colors mode'.

    @alisonmaher Do you recall the morivation for this?

    It seems to me that the easiest fix would be to keep the first definition, but move the part about forced color mode into it (applying only to system and deprecated colors) which would make the second section only about transparent and currentcolor.

    Also, I recall why I had (started to) move the system and deprecated colors out of the sRGB section:

    so that second section was meant to allow non-sRGB system colors. Which no-one, to my knowledge, does?

  4. Loirooriol commented on Feb 5, 2026

    @Loirooriol
    ContributorAuthor

    I was looking at the 1st definition, but it wasn't clear to me that "deprecated-colors" means "deprecated system colors".
    The 2nd definition makes it clearer with the parenthetical.

    Also, from the 2nd definition:

    The declared value for each <system-color> keyword and <deprecated-color> keyword is itself.

    This is not clear in the 1st definition:

    If the sRGB color was explicitly specified by the author as a named color, or as a system color, the declared value is that named or system color, converted to ASCII lowercase.

    Does "system color" include deprecated ones? Above they are listed separately, so I would think it's not included, but then

    Otherwise, the declared, computed and used value is the corresponding sRGB color

    which is wrong for deprecated system colors.

    So please don't just use the 1st definition without making all of this clear.

  5. alisonmaher commented on Feb 5, 2026

    @alisonmaher
    Collaborator

    However, such colors must not be altered by 'forced colors mode'.

    @alisonmaher Do you recall the morivation for this?

    Tried to find an old PR that might have had more context around this but came up short.

    My guess is that this may be because we decided that in forced colors mode, we don't override a property if it is already set to a system color. So, for example, if an author sets color: ButtonText we won't override this to color: CanvasText. My read of the text is that this may allow us to preserve the author system color to ensure this is rule is maintained in forced colors mode.

  6. svgeesus commented on Feb 6, 2026

    @svgeesus
    Collaborator

    I was looking at the 1st definition, but it wasn't clear to me that "deprecated-colors" means "deprecated system colors".

    Ok, I will be more explicit.

    Does "system color" include deprecated ones?

    No.

  7. svgeesus commented on Jul 15, 2026

    @svgeesus
    Collaborator

    So now:

    • system colors and deprecated system colors are explicitly named like that (one does not include the other)
    • resolution is in the "other colors" section
    • they both resolve to themselves, converted to ascii lowercase
    • computed and used values for both are the actual color (which need not be sRGB)
    • alpha handling is specified
    • they are both not altered by forced colors mode

    @Loirooriol is that okay now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Closed Accepted as Obvious BugfixFixed an obvious error with the obvious solution.Commenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.css-color-4Current Work

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions