Skip to content

[css-overflow] Positioning Scrollbars on top or left of container #1293

@praveenpuglia

Description

@praveenpuglia

From time to time, I have encountered cases where having a horizontal scrollbar at the top or left would be more helpful than having it at the bottom. For example, consider a long table that forces a vertical scrollbar. Also, it has so much content that the space required on horizontal axis is more than what viewport width can provide.

Or when something like bootstrap responsive table is needed, which has a horizontal scroll in smaller screen-size.

A lot of times, due to the amount of vertical content, the presence of a horizontal scrollbar is not known to the end user or they have to scroll further down where they can't see table headers anymore. As a result, users don't realize that the content can be scrolled.

The situation is worse for mobile browsers because they generally have overlay scrollbars which only appear when you at least tap on the content.

Chrome on phones at least give a flash as to which containers have scrollbars and then it goes away.

In these sort of cases and others like (RTL languages) wouldn't it be great to have an option to change the position of the scrollbars?

Right now, the trick that I use is something like this.

.parent {
  transform: rotateX(180deg);
  overflow-x: auto;
} 
.child {
  transform: rotateX(180deg);
}

This way, the horizontal scrollbar appears on top. This hack however isn't all that great and has it's own problems.

I know that scrollbar is a browser chrome thing and it's still not allowed to style by end users for reasons. But can there be properties that at least let the users set the position of scrollbars?

For example

.parent{
  scrollbar-x-position: top; /*either top or bottom, default is bottom or dir based*/
  scrollbar-y-position: left; /*either left or right, default is right or dir based*/
}

I'll be happy to know the reasons if this was thought before and dropped.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions