Skip to content
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

scrollbar-color CSS property #417

Closed
1 of 3 tasks
ramiy opened this issue Sep 14, 2023 · 14 comments
Closed
1 of 3 tasks

scrollbar-color CSS property #417

ramiy opened this issue Sep 14, 2023 · 14 comments
Labels
focus-area-proposal Focus Area Proposal

Comments

@ramiy
Copy link
Contributor

ramiy commented Sep 14, 2023

Description

Developers need a standard and cross-browser solution to style scrollbars for elements with overflow: scroll;.

There are two alternatives to style scrollbars, the widely supported non-standard ::-webkit-scrollbar-* pseudo-elements or the new standard scrollbar-* properties defined in the CSS Scrollbars Styling Module spec. Both alternatives are not cross-browser supported.

The non-standard ::-webkit-scrollbar-* pseudo-elements supported by all browsers except Firefox. While scrollbar-width and scrollbar-color properties are supported only by Firefox.

This is not an optimal situation for developers. We need a single solution implemented by all browsers.

Specification

https://drafts.csswg.org/css-scrollbars/

Open Issues

No response

Tests

https://wpt.fyi/results/css/css-scrollbars?label=master&label=experimental&aligned

Current Implementations

  • Blink
  • Gecko
  • WebKit

Standards Positions

No response

Browser bug reports

https://bugs.chromium.org/p/chromium/issues/detail?id=891944

Developer discussions

No response

Polls & Surveys

scrollbar-gutter was mentioned in State of CSS 2023 and State of CSS 2022.

This CSS property is not related to this spec but it is related to scrollbars in general.

Existing Usage

https://caniuse.com/css-scrollbar
https://chromestatus.com/metrics/css/timeline/popularity/763
https://chromestatus.com/metrics/css/timeline/popularity/680

Workarounds

Non-standard ::-webkit-scrollbar-* pseudo-elements or JS libraries.

Accessibility Impact

No response

Privacy Impact

No response

Other

No response

@ramiy ramiy added the focus-area-proposal Focus Area Proposal label Sep 14, 2023
@lukewarlow
Copy link
Member

#419 issue for scrollbar-gutter that was referenced above

@lukewarlow
Copy link
Member

@lukewarlow
Copy link
Member

lukewarlow commented Sep 14, 2023

As for accessibility impact the standard properties should be a net positive for accessibility as you can use user styles to more easily undo the styles. There's also better integration with the likes of forced-colors mode (scrollbar-color is reset to auto).

@lukewarlow
Copy link
Member

It's also worth being aware there's partial implementations of both scrollbar-color and scrollbar-width in Chromium and WebKit so the gap to interopability shouldn't be as big as if there was no implementation. (Safari is blocked by platform APIs for scrollbar-color however)

@karlcow
Copy link

karlcow commented Sep 14, 2023

This is a pressure point for Firefox webcompat.
https://github.com/search?q=repo%3Amozilla-extensions%2Fwebcompat-addon%20scrollbar&type=code

@foolip
Copy link
Member

foolip commented Sep 18, 2023

@jensimmons jensimmons changed the title CSS Scrollbars CSS Scrollbar styling Sep 21, 2023
@nt1m
Copy link
Member

nt1m commented Oct 7, 2023

Can we split this proposal into scrollbar-width & scrollbar-color for evaluation?

@nt1m nt1m changed the title CSS Scrollbar styling scrollbar-width CSS property Oct 7, 2023
@nt1m nt1m changed the title scrollbar-width CSS property scrollbar-color CSS property Oct 7, 2023
@nt1m nt1m mentioned this issue Oct 7, 2023
3 tasks
@nt1m
Copy link
Member

nt1m commented Oct 7, 2023

I split out scrollbar-width into its own proposal: #571

@lukewarlow
Copy link
Member

@svgeesus
Copy link

svgeesus commented Jan 5, 2024

Test results for existing WPT for scrollbar-color show interop between Chrome, Edge and Firefox with Safari trailing (23/38).

The specification does not have WPT annotations so I don't know how extensive the WPT coverage is (but it is a single property, so not too complicated).

The existing WPT all use sRGB colors (plus named colors and currentColor). There are no tests with wide gamut colors etc.

@svgeesus
Copy link

svgeesus commented Jan 5, 2024

Safari failures seem to mainly relate to:

  • CSS keywords like inherit, initial
  • interaction with ::-webkit-scrollbar*

@nt1m
Copy link
Member

nt1m commented Jan 5, 2024

Safari doesn't have scrollbar-color support enabled, because the visual effect of the property isn't implemented atm.

@lukewarlow
Copy link
Member

Safari's pass rate will be inflated as well because many of the tests are for invalidation which appears to pass in safari (because the property has no actual effect).

I don't think WPT can effectively test the actual rendering as it's so platform dependent

@wpt-interop
Copy link

Thank you for proposing scrollbar-color CSS property for inclusion in Interop 2024.

We wanted to let you know that this proposal was not selected to be part of Interop this year.

This is because we got many more proposals than we could include in this year's project. Note that individual vendors may nevertheless choose to advance work in this area during the forthcoming year. We would welcome this proposal being resubmitted again next year if necessary.

For an overview of our process, see proposal selection. Thank you again for contributing to Interop 2024!

Posted on behalf of the Interop team.

@foolip foolip closed this as completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus-area-proposal Focus Area Proposal
Projects
Status: Done
Development

No branches or pull requests

7 participants