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-overflow-4] defaults for scrollbar-gutter in the block axis #5252

Open
frivoal opened this issue Jun 23, 2020 · 2 comments
Open

[css-overflow-4] defaults for scrollbar-gutter in the block axis #5252

frivoal opened this issue Jun 23, 2020 · 2 comments
Assignees

Comments

@frivoal
Copy link
Collaborator

frivoal commented Jun 23, 2020

https://drafts.csswg.org/css-overflow-4/#scrollbar-gutter-property says:

The presence of a scrollbar gutter at the block start edge and block end edge of the box cannot be controlled in this level, and is determined the same way as the presence of scrollbar gutters placed at the inline start edge or inline end edge of the box when scrollbar-gutter is auto.

We could later, if we wanted to, expand the scrollbar-gutter property to take a second value that describes the block start / block end gutters, and which defaults to auto when omitted.

However, this means were deciding now that the default is auto. Maybe that's fine. But also, auto is the default only because legacy behavior, not because it's better. So the default could also be (for example) auto if the first value is auto but stable otherwise. Or maybe something else.

The point is, if what we're defining now is the shorthand, we have to decide now what the default in the other axis is.

If we don't want to make that decision now, we could just define scrollbar-inline-gutter and worry later about what the other axis later defaults to when you omit it from the shorthand.

@frivoal frivoal self-assigned this Jun 23, 2020
@frivoal
Copy link
Collaborator Author

frivoal commented Jun 23, 2020

cc @felipeerias

@felipeerias
Copy link

As @frivoal says, it makes sense to allow some control over the gutters along the block direction: when an author wants to prevent scrollbars in the inline direction from changing the layout, it seems likely that scrollbars in the block direction shouldn't change it either.

My current understanding is that this block-gutter would occupy the same space that is taken up by the scrollbar, and thus remain visible at all times (as opposed to being drawn as an extension of the padding, in which case it would only be visible after the user has scrolled to the end of the content area).

So, this is the space currently taken up by overflow: scroll; scrollbars:

issue5252_example_1

With scrollbar-gutter: stable; and classic scrollbars, both are replaced by their gutters when the content is not scrolling:

issue5252_example_2

However, as the content begins to grow and steps on the block-gutter, it is my understanding that it would become necessary (probably, see #5253) to add a scrollbar so that the content can still be viewed. This might be a surprising behaviour for Web authors:

issue5252_example_3

(Note that the author could prevent that behaviour with overflow-block; hidden;, but losing the ability to scroll horizontally if needed.)

Compare this with what we would get if the default block-gutter was auto, in which case the content would still have some room to grow before triggering a scrollbar:

issue5252_example_4

In light of the above and after some consideration, I am currently leaning more towards auto as the default in the block direction, plus defining a way for authors to opt-in to more control (where adding a second value in scrollbar-gutter sounds like a good idea).

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

2 participants