You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-ui] Proposal: change outline-offset initial value to auto #13587
When outline-style: auto is used in combination with outline-offset,
Chrome currently subtracts around 1px from the used value of outline-offset to help keep focus outlines visible in overflow scenarios not handled by authors.
Unfortunately, when the author wants to handle the offset themselves, this makes outline-offset very hard to use in a predictable way in Chrome and in an interoperable way across browsers.
In other UAs, outline-offset currently behaves normally with outline-style: auto, but I don’t think this interaction is clearly specified, so I’m not sure there is a guarantee that this behavior would not change in the future, for example due to UA stylistic or accessibility changes.
Maybe changing the initial value of outline-offset to auto could give UAs enough flexibility to choose their own default offset, while making numeric values specified by authors behave normally.
changed the title [-][css-ui] Proposal: Allow `outline-offset` to reflect the effective offset for `outline-style: auto`[/-][+][css-ui] Proposal: change `outline-offset` initial value to `auto`[/+]on May 25, 2026
I gave a look at Chrome code... it's effective offset is basically:
(All lengths are in device pixels)
// specifiedSnappedOffset = ...// minBorderWidth = ...// effectiveZoom = devicePixelRatio * totalZoom;letoffset=specifiedSnappedOffset;constmaxInsideBorderWidth=Math.max(Math.floor(1*effectiveZoom),1);if(minBorderWidth>=maxInsideBorderWidth)offset-=maxInsideBorderWidth;consthalfInnerStrokeWidth=Math.max(Math.floor(3*effectiveZoom),3)/3;// const innerStrokeWidth = halfInnerStrokeWidth * 2;offset-=halfInnerStrokeWidth;// InnerStrokeWidth is not always an integer. If effectiveZoom is between N + 0.3333... and N + 1// then Chrome renders blurry outlines for these values.// this offset includes the blurry partflooredOffset=Math.floor(offset);
Activity
sb3nder commentedon Mar 11, 2026
sb3nder commentedon Apr 6, 2026
Update regarding WebKit (as of today, build 310633@main):
for
outline-style: auto:outline-widthis no longer taken into consideration.outline-offset: 0pxhas an effective offset of 0px, and any other value also reflects the effective offset.Fix outline: auto in user agent style sheets WebKit#1740
Enable zooming outline: auto WebKit#61077
Ignore outline-width when outline-style is auto WebKit#61497
Super happy with these changes.
sb3nder commentedon Apr 6, 2026
Additionally, WebKit is proposing
outline-offset: inset#13765, but I'm still unsure if it's the right approach as currently proposed.[-][css-ui] Proposal: Allow `outline-offset` to reflect the effective offset for `outline-style: auto`[/-][+][css-ui] Proposal: change `outline-offset` initial value to `auto`[/+]sb3nder commentedon May 25, 2026
I gave a look at Chrome code... it's effective offset is basically:
(All lengths are in device pixels)