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

Specify color-scheme for each theme #2236

Merged
merged 1 commit into from
Oct 7, 2023
Merged

Conversation

Dubzer
Copy link
Contributor

@Dubzer Dubzer commented Oct 2, 2023

This PR adds a CSS property color-scheme to _schemes.scss.
It allows the browser to apply the appropriate default user-agent styles for the current theme. For example, to use dark scrollbar on Windows in chromium-based browsers.

Learn more about this property: https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme

Here's an example of improvement in scrollbar style for dark themes on Windows in MS Edge:

Before After
image image

@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Oct 2, 2023
@syphar
Copy link
Member

syphar commented Oct 3, 2023

r? @Nemo157 @GuillaumeGomez

@Nemo157
Copy link
Member

Nemo157 commented Oct 3, 2023

Interesting, this doesn't seem to do much in firefox because rustdoc sets the scrollbar-color overriding it (to something that's hard to see with just the thumb visible in dark 😔), and even if it didn't firefox appears to base the scrollbar color on the background-color, but chromium browsers and safari don't support setting it yet and I guess don't auto-derive a good color so this is useful in them (and probably for any other effects it might have).

Copy link
Member

@Nemo157 Nemo157 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd still like @GuillaumeGomez to take a look too.

@GuillaumeGomez
Copy link
Member

I'll try to take a look by the end of the week.

@GuillaumeGomez
Copy link
Member

Looks all good to me, thanks!

@GuillaumeGomez GuillaumeGomez merged commit 0fb8970 into rust-lang:master Oct 7, 2023
@github-actions github-actions bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Oct 7, 2023
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Oct 11, 2023
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.

4 participants