Skip to content

[css-ui] Should outline-offset be a longhand of outline? #8788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Loirooriol opened this issue May 2, 2023 · 6 comments
Closed

[css-ui] Should outline-offset be a longhand of outline? #8788

Loirooriol opened this issue May 2, 2023 · 6 comments

Comments

@Loirooriol
Copy link
Contributor

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

The outline property is a shorthand property and sets all three of outline-style, outline-width, and outline-color.

This is verbatim taken from https://www.w3.org/TR/CSS2/ui.html#dynamic-outlines:

The 'outline' property is a shorthand property, and sets all three of 'outline-style', 'outline-width', and 'outline-color'.

But CSS UI added outline-offset, which didn't exist in CSS2.
So I don't know if leaving it out of the shorthand was deliberate or not.

@Loirooriol
Copy link
Contributor Author

BTW, it's not a longhand in Gecko/Blink/WebKit.

@frivoal
Copy link
Collaborator

frivoal commented Jun 6, 2024

Its introduction predates my involvement with css-ui, so I am not sure if it is deliberate or not, but I would be cautious about changing it now. We most likely have a lot of content with built-in assumptions that changing the value of outline does not reset outline-offset, and changing the relationship would invalidate that. In particular, I worry that outline-offset is used to ensure that the outline is visible, in cases where it may otherwise be obscured by other content, or by a container whose overflow is not `visible. Resetting it could then make the outline invisible, and that could get in the way of accessibility, as it is often used as a focus indicator.

If we could ascertain that there is no compat problem, then I'd be in favor of the change, but I am skeptical that we can.

@dbaron
Copy link
Member

dbaron commented Jul 30, 2024

I'm not even sure I'd be in favor of this if we were starting from scratch. I think it's quite reasonable to want to change the outline style, width, and color all together without changing the offset. I think the outline style/width/color are "what does the focus outline look like" and outline-offset is "where does the focus outline go". (It's sort of like margin, but it's an entirely separate margin just for the outline.)

@Loirooriol
Copy link
Contributor Author

I'm fine with not including outline-offset in the shorthand, but then I would like a clarifying note like in https://drafts.csswg.org/css-text-decor-3/#text-decoration-property

The shorthand purposefully omits the text-underline-position property, which is a language/writing-system–dependent setting that keys off the content, so that it can cascade and inherit independently from the (uninherited) stylistic settings of the text-decoration shorthand.

@frivoal
Copy link
Collaborator

frivoal commented Jul 31, 2024

I've added a note, as suggested above. That's just an editorial change, so we don't need a group resolution for that.

Should we close this issue, or do we want an explicit group resolution about making no normative change? (cc: @atanassov @astearns )

@astearns
Copy link
Member

@Loirooriol go ahead and close this issue if you are good with the current outcome

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

No branches or pull requests

4 participants