Skip to content

[css-ui-4] outline-color: auto should not be required to represent the accent color #14148

Open

Description

@sb3nder

The spec currently says:

When outline-style is auto, outline-color: auto computes to auto and represents the accent color.

I don't think outline-color: auto should be required to represent the accent color.

When a control already uses the accent color, drawing the focus outline in the same color can make the outline less distinguishable from the control itself. Since the purpose of the outline is to clearly indicate focus, it should remain visually distinct.

I think outline-color: auto should instead be left up to the UA, allowing it to choose a color that provides a more effective focus indicator while still matching the platform's design.

Activity

  1. zcorpan commented on Sep 9, 2026

    @zcorpan
    Contributor

    I agree with this and was surprised that accent-color affected the outline color in Firefox (it's still the system outline color in Safari and Chrome, on macOS at least). cc @emilio

  2. emilio commented on Sep 10, 2026

    @emilio
    Collaborator

    What's the surprising part? The form controls should look consistent when focused and we use the accent color to style them.

  3. zcorpan commented on Sep 10, 2026

    @zcorpan
    Contributor

    If I want to change accent-color but only for checkboxes, now the focus outline color is inconsistent across focusable elements, with no way to undo the focus outline color AFAIK. (Demo.)

    On the other hand, changing the OS theme color in macOS changes both the control color and the focus outline color. But it's a global switch, not per-control.

  4. emilio commented on Sep 10, 2026

    @emilio
    Collaborator

    I'm still confused about the use case tho, why would you want inconsistent accent-color? In any case I think it's ok not to require this per spec but...

  5. zcorpan commented on Sep 10, 2026

    @zcorpan
    Contributor

    Text fields and buttons usually aren't affected by accent-color except for the focus ring, so it seems reasonable to want to tweak the color of checkboxes without wanting it to affect the focus ring. (Compare with the "Comment" button below which is green, but has a blue focus ring, consistent with all other focusable elements in the page.)

  6. zcorpan commented on Sep 10, 2026

    @zcorpan
    Contributor

    An option could be to support outline-color: system-accent-color or so which uses the system accent color instead of taking the accent-color.

  7. sb3nder commented on Sep 10, 2026

    @sb3nder
    ContributorAuthor

    can't outline-color: auto be the system color, and outline-color: AccentColor take accent-color?

  8. emilio commented on Sep 10, 2026

    @emilio
    Collaborator

    The problem is that outline-style: auto does more things than outline-style: solid, and outline-style: auto doesn't respect outline-color (and can't, because by default it would turn all outlines black).

  9. sb3nder commented on Sep 10, 2026

    @sb3nder
    ContributorAuthor

    Why?

    The spec says:

    User agents may enable authors to influence the rendering of auto style outlines via the outline-color property, but this specification does not define how the rendering is impacted (if at all).

    In Chrome outline-color works fine with outline-style: auto.

  10. emilio commented on Sep 10, 2026

    @emilio
    Collaborator

    Huh, I guess it does. That's a bit weird tho? I find it weird that this has a black outline:

    data:text/html,<span style="outline: auto">Foobar
    

    Just because outline-color defaults to currentColor?

  11. emilio commented on Sep 10, 2026

    @emilio
    Collaborator

    I guess what Blink does in the UA sheet to prevent that by default is:

    :focus-visible { outline: -webkit-focus-ring-color auto 1px }
  12. sb3nder commented on Sep 10, 2026

    @sb3nder
    ContributorAuthor

    Maybe -webkit-focus-ring-color could be removed if outline-color: auto does the same thing.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions