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

fix(theme): add option for controlling :root color-scheme #1468

Merged
merged 4 commits into from
Apr 12, 2024

Conversation

resure
Copy link
Contributor

@resure resure commented Mar 30, 2024

Curently UIKit provides custom scrollbars by default that can be disabled using nativeScrollbar option on the ThemeProvider.

However, on Chrome-based browsers on Windows, native scrollbars appear white even when dark mode on the body is enabled (and setting color-scheme: dark on the body tag does not help).

Example

Screenshot 2024-03-30 195922

To get proper dark scrollbars we need to set color-scheme: dark on the :root element (html tag). GitHub itself, for example, is doing exactly that.

This PR adds color-scheme styling to :root (but this new styles only apply when uikit theme is not scoped).

Examples with color-scheme on :root

Screenshot 2024-03-30 214755 Screenshot 2024-03-30 203519

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@gravity-ui-bot
Copy link
Contributor

Playwright Test Component is ready.

@resure resure marked this pull request as ready for review April 9, 2024 20:34
@resure resure requested review from amje, ValeraS and korvin89 as code owners April 9, 2024 20:34
@korvin89 korvin89 changed the title feat(theme): add option for controlling :root color-scheme fix(theme): add option for controlling :root color-scheme Apr 10, 2024
@korvin89 korvin89 merged commit f6237e1 into gravity-ui:main Apr 12, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants