add support for coloring using CSS variables #149
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you very much for your contribution! Please make sure the followings
are checked.
npm test
to make sure it formats and build successfullyThis PR adds support for coloring the scrollbar via CSS variables.
A demo is included within this PR in
examples/colors.html
which was derived fromexamples/basic.html
.I was in need to support a dark mode variant of my project but coloring of the scrollbars did not fit. Instead of redefining all the selectors to set the CSS color attributes within my project, I wanted a more robust solution.
This fixes #15, #102
Now colors are easily modifiable by CSS variables if the browser supports them. If the browser does not support CSS variables it defaults back to the old mechanism, making it compatible with at least IE11.
To set the colors simply add the following snippet to your project's CSS