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

doc: make scrollbar wider in large screens #6445

Conversation

claudiorodriguez
Copy link
Contributor

Checklist
  • the commit message follows commit guidelines
Affected core subsystem(s)

doc

Description of change

Adds media queries to doc css to make TOC and content scrollbars
wider in larger screens.

Fixes: #6443

@claudiorodriguez claudiorodriguez added the doc Issues and PRs related to the documentations. label Apr 28, 2016
@ChALkeR
Copy link
Member

ChALkeR commented Apr 28, 2016

Perhaps just 0.8vw?

@claudiorodriguez
Copy link
Contributor Author

@ChALkeR 0.7vw kinda works for 2048+, so that's one less media query, but for 1280-2048 I can't find a satisfying value of vw that will work across all widths. Not a UX expert though.

@claudiorodriguez claudiorodriguez force-pushed the docs-scrollbar-width-large-screens branch from 1c95ed7 to 3e8d713 Compare April 28, 2016 16:06
@jasnell
Copy link
Member

jasnell commented Apr 28, 2016

@nodejs/documentation @nodejs/website

@eljefedelrodeodeljefe
Copy link
Contributor

LGTM let's land this and improve later. nit: Can you provide a screenshot of a rendered page?

@mathiask88
Copy link
Contributor

I injected the change in chrome. Maybe 0.7vw is a bit too much
image

This is 0.5vw
image

@eljefedelrodeodeljefe
Copy link
Contributor

yeah. if no-one objects I'd go with 0.5

@claudiorodriguez claudiorodriguez force-pushed the docs-scrollbar-width-large-screens branch from 3e8d713 to 24fef71 Compare April 28, 2016 17:21
::-webkit-scrollbar {
width: 0.5vw;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a new line at the end of file?

@phillipj
Copy link
Member

LGTM other than my little inline nitpick

Adds media queries to doc css to make TOC and content scrollbars
wider in larger screens.

Fixes: nodejs#6443
PR-URL: nodejs#6445
@claudiorodriguez claudiorodriguez force-pushed the docs-scrollbar-width-large-screens branch from 24fef71 to 0c3f6c1 Compare April 28, 2016 19:12
@preco21
Copy link

preco21 commented Apr 29, 2016

LGTM for 0.5vw!

@ChALkeR
Copy link
Member

ChALkeR commented Apr 29, 2016

@mathiask88 The reason for 0.7vw being to much is because it is now relative to the screen width, and does not correspond to the size of other elements on the page.

Body font size is in css pixels, and I still don't understand why should the scrollbar size be increased for certain monitor widths but not the text itself.

I don't want to block this change though, as other ones think that it's a good idea, so -0 from me.

@mathiask88
Copy link
Contributor

@ChALkeR I often work side by side like this
image
and Text sizes are totally okay. But the scrollbar width is not.I don't know if 0.5vw is the best solution. If I'm honest I don't like the custom bars at all.The default one is always good to catch isn't it?
image

@claudiorodriguez
Copy link
Contributor Author

I'll leave this PR open for several days to get more opinions on this. I see this as a small incremental change that, even if not perfect, will improve the current situation. The responsiveness of the doc site to different screens evidently needs some reworking (text size should probably scale, etc), but I'd leave that to future PRs.

Right now the issue seems to be whether to remove the custom scrollbars entirely, or to keep this PR as is (or with some changes).

@eljefedelrodeodeljefe
Copy link
Contributor

If there are no strong objections, I'll merge this in a couple of hours. Something off the books and taking new PRs is better, imo.

@silverwind
Copy link
Contributor

Scaling the scrollbar based on width seems like a hack to me. Nothing else on the page scales with the width, why whould the scrollbar do? No strong objection thought.

By the way, for resolutions above 1080p, I'd suggest enabling OS-based scaling. Web sites are likely never going to support these resolutions properly.

@ChALkeR
Copy link
Member

ChALkeR commented Apr 29, 2016

I also view this as a hack, and (as I stated above) I don't understand why should we scale the scrollbar size, but not the text size?

If the scrollbar is too small — perhaps we should just increase its width to 15px on all screens?

@silverwind
Copy link
Contributor

silverwind commented Apr 29, 2016

If the scrollbar is too small — perhaps we should just increase its width to 15px on all screens?

My suggestion would be to make it either static 16px or em-based (1em).

@ChALkeR
Copy link
Member

ChALkeR commented Apr 29, 2016

I will file an alternative PR shortly.

@mathiask88
Copy link
Contributor

mathiask88 commented Apr 29, 2016

By the way, for resolutions above 1080p, I'd suggest enabling OS-based scaling. Web sites are likely never going to support these resolutions properly.

@silverwind I'm okay with the look and feel, text sizes etc. of all the web sites I use and I like the huge amount of space, but if a scroll bar is only a third of the width of the default bar then there is something wrong. Os based scaling is no option for me because it will introduce problems like blurry apps etc.

@lpinca
Copy link
Member

lpinca commented Apr 29, 2016

Why the scrollbar has been customized in the first place?
Can't we use browser default scrollbar? This customization only works on WebKit based browsers anyway.

@silverwind
Copy link
Contributor

Can't we use browser default scrollbar? This customization only works on WebKit based browsers anyway.

Just eye-candy basically. I could see us reducing the styling to just colors, removing dimension changes.

@ChALkeR
Copy link
Member

ChALkeR commented Apr 29, 2016

See #6474.

@lpinca
Copy link
Member

lpinca commented Apr 29, 2016

Another minor thing I noticed with the customization is that for example on OS X the scrollbar is always visible (does not auto hide). Maybe it is expected.

@silverwind
Copy link
Contributor

does not auto hide

I think that's controlled by ::-webkit-scrollbar-thumb:window-inactive.

@claudiorodriguez
Copy link
Contributor Author

Ok, so I made #6479 which, following suggestions from some, just removes all scrollbar styling altogether.

@claudiorodriguez
Copy link
Contributor Author

Closed in favour of #6479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Scrollbar width
9 participants