Skip to content

scrollbar-default does not work on webkit browser #19

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

Closed
eyupaltindal opened this issue Feb 12, 2022 · 4 comments
Closed

scrollbar-default does not work on webkit browser #19

eyupaltindal opened this issue Feb 12, 2022 · 4 comments

Comments

@eyupaltindal
Copy link

eyupaltindal commented Feb 12, 2022

I have some problem with webkit browsers.

scrollbar-hide class works as perfect. but i want to show it with scrollbar-default class, scrollbar is visible on webkit browser. it works on firefox.

i need help with that issue. thanks.

@reslear
Copy link
Owner

reslear commented Feb 13, 2022

show you full class case

@eyupaltindal
Copy link
Author

eyupaltindal commented Feb 13, 2022

My code like this;

<div class='tw-layout-container tw-pb-12 md:tw-pb-20'>
  <pm-ui-lp-section-header>Psikolojik Konular</pm-ui-lp-section-header>
  <div class='tw-flex tw-gap-4 md:tw-gap-5 tw-overflow-x-auto tw-scrollbar-hide md:tw-scrollbar-default'>
    <div class='tw-flex-shrink-0' *ngFor='let evergreenPost of evergreenPosts'>
      <shared-ui-button buttonSize='large'>{{evergreenPost.title}}</shared-ui-button>
    </div>
  </div>
</div>

This is with Firefox
image

This is with Chrome
image

@reslear
Copy link
Owner

reslear commented Apr 3, 2022

Yes, you are right, I investigated that webkit not support overriding

::-webkit-scrollbar cannot be simply overridden to get the default style, the only way to do it is to remove all ::-webkit-scrollbar rules from the code. At that point, scrollable areas have to be forced to redraw the scrollbars. To do that you either quickly add and remove display:none; from or do the same thing with overflow:hidden; on scrollable elements. The problem with the first one is that the page flashes white at every page load; the second one is resource-intensive as it would have to whether check any element on the page overflows—not ideal.
https://webapps.stackexchange.com/a/26128

For a workaround use desktop first breakpoint system or dynamic remove class with script
example in you case https://play.tailwindcss.com/DfHZcGih7B?size=598x720

@reslear reslear closed this as completed Apr 3, 2022
reslear added a commit that referenced this issue Apr 3, 2022
@reslear
Copy link
Owner

reslear commented Feb 7, 2023

so @eyupaltindal no need scrollbar-default use https://tailwindcss.com/blog/tailwindcss-v3-2#max-width-and-dynamic-breakpoints

like: max-md:scrollbar-hide

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

No branches or pull requests

2 participants