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

Suggestion for global styling #591

Closed
egorkel-altexsoft opened this issue May 10, 2024 · 0 comments · Fixed by #619
Closed

Suggestion for global styling #591

egorkel-altexsoft opened this issue May 10, 2024 · 0 comments · Fixed by #619
Labels

Comments

@egorkel-altexsoft
Copy link

Feature Description

Usually, we want scrollbar styles to be consistent throughout the whole application. Of course, we can add style to each ng-scrollbar tag and then write something like this in our global styles

ng-scrollbar.custom-scrollbar {
  --scrollbar-thickness: 10;
  --scrollbar-thumb-color: grey;
  ...
}

But it requires adding a custom style to each tag.

<ng-scrollbar class="custom-scrollbar">...</ng-scrollbar>

You already have CSS vars. I suggest using them more flexibly.

  --ng-scrollbar-thickness: var(--scrollbar-thickness, 5);
  --ng-scrollbar-thumb-color: var(--scrollbar-thumb-color, rgb(0 0 0 / 20%));
  ...

The library uses prefixed vars with default fallbacks. And we can easily customize styles by defining required vars.

Use Case

In this case, we can define vars on root

:root {
  --scrollbar-thickness: 10;
  --scrollbar-thumb-color: grey;
  ...
}

and use scrollbars without additional classes

<ng-scrollbar>...</ng-scrollbar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants