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

bug: Scrollbar not stylable #30126

Closed
3 tasks done
Rufai-Ahmed opened this issue Jan 9, 2025 · 3 comments
Closed
3 tasks done

bug: Scrollbar not stylable #30126

Rufai-Ahmed opened this issue Jan 9, 2025 · 3 comments
Labels

Comments

@Rufai-Ahmed
Copy link

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

I can't style the scrollbar when trying this:

::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, 0);
  border-radius: 10px; 
}

::-webkit-scrollbar {
  width: 12px;
  background-color: transparent; 
}

::-webkit-scrollbar-thumb {
  border: 1px solid rgba(0, 0, 0, 0);
  background-clip: padding-box;
  border-radius: 3em;
  background-color: rgba(0, 124, 182, 0.69) 
}

::-webkit-scrollbar-corner {
  background-color: transparent;
}

And I've also looked at previous threads concerning this and the profferred solution was to check this codepen implementation, but it's no longer working.

https://codepen.io/liamdebeasi/pen/QWbEbpO

Expected Behavior

I expect it to style the scrollbar.

Steps to Reproduce

Just attempt to change the style of the scrollbar on an ionic application

Code Reproduction URL

https://

Ionic Info

[ERROR] Invalid project type: angular-standalone (project config: .\ionic.config.json).

    Project type must be one of: angular, ionic-angular, ionic1, custom, react, vue

Bad project type: undefined

It's probably showing this because it's an nx monorepo

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Jan 9, 2025
@HookdaCode
Copy link

Try these in your CSS file, it should be working:

`
ion-content {
--ion-scroll-bar-color: red;
--ion-scroll-bar-background: #f1f1f1;
}

ion-content::part(scroll) {
scrollbar-width: thin;
scrollbar-color: red #f1f1f1;
}

ion-content::part(scroll)::-webkit-scrollbar {
width: 10px;
}

ion-content::part(scroll)::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 10px;
}

ion-content::part(scroll)::-webkit-scrollbar-thumb {
background: red;
border-radius: 10px;
}

ion-content::part(scroll)::-webkit-scrollbar-thumb:hover {
background: #b30000;
}
`

@Rufai-Ahmed
Copy link
Author

It works, thanks.

Copy link

ionitron-bot bot commented Mar 14, 2025

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Mar 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants