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

[css-scrollbars-1] Make scrollbar-width inheritable #3671

Closed
wants to merge 1 commit into from
Closed

[css-scrollbars-1] Make scrollbar-width inheritable #3671

wants to merge 1 commit into from

Conversation

xPaw
Copy link

@xPaw xPaw commented Feb 22, 2019

We wanted to add custom scrollbar properties in our app, as these properties already shipped in Firefox, but realized an oddity.

scrollbar-color can be applied to body, and any child elements with a scrollbar will have the color applied, but this doesn't work on scrollbar-width and requires each scrollable element to have it defined separately.

I could not find any discussion on this.

@emilio
Copy link
Collaborator

emilio commented Feb 23, 2019

I'm not sure this is desirable, you wouldn't want to make html { scrollbar-width: none } disable all scrollbars in the page.

@emilio
Copy link
Collaborator

emilio commented Feb 23, 2019

cc @upsuper @tantek

@jonjohnjohnson
Copy link

jonjohnjohnson commented Feb 23, 2019

What @emilio said, especially since this (less common) case is solved with a simple...

:where(:root) { scrollbar-width: none; }
:where(*)     { scrollbar-width: inherit; }

@upsuper
Copy link
Member

upsuper commented Feb 23, 2019

All CSS properties are inheritable, via specifying property: inherit as mentioned by @jonjohnjohnson. The "inherited" field just means whether the property inherits by default.

Based on use case analysis mentioned in the spec, we consider scrollbar-color to serve the use cases for assigning kind of theme colors to scrollbars, which usually applies page-wise, so it is inherited by default, while scrollbar-width is for addressing cases where specific elements may be too small to show a full-width scrollbar, or elements that has custom scrollbar want to hide the default scrollbar, so it is not made inherited by default.

Given the usecases as well as the existence of "workaround" if you really want to inherit that property, I don't think we are going to take this change, so closing this PR.

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

Successfully merging this pull request may close these issues.

None yet

4 participants