Skip to content

[css-ui][css-pseudo] clarify outline's behavior on pseudo elements #3539

@mattdrose

Description

@mattdrose

https://drafts.csswg.org/css-ui-4/#outline-props

The outlines spec isn't clear when it comes to pseudo elements. This means that behaviour differs greatly between browsers.

Safari: Outline doesn't affect pseudo elements
Firefox: Outline will expand to include pseudo elements
Chrome: Outline will only include pseudo elements when: 1) the block is relative 2) the outline-style is auto

Codepen example: https://codepen.io/mattdrose/pen/OreqYg

I especially find Chrome's behaviour odd, and thus opened an issue. Triaging is difficult, however, since the spec is so loose on expected behaviour—you can't detect what is and isn't a bug.

I know this isn't the only issue of it's kind (outlines affect on descendant's also varies is also inconsistent). I personally believe that narrowing down outlines affect on pseudo elements and descendants would help browsers, developers, and end users alike.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions