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

Implemented dark variant #105

Closed
wants to merge 2 commits into from

Conversation

azmeuk
Copy link

@azmeuk azmeuk commented Jun 26, 2022

I took the color related CSS and made variables from them. The dark versions of those variables come from what DarkReader would have suggested.
The menu background image is disabled in dark mode.
I added the highlightjs github dark variant, so highlighted code also display well with dark theme.

The light theme should be unchanged.

I am not a designer so it is probably not perfect, but at least this is a start :)

Screenshot 2022-06-26 at 12-50-58 Welcome to MkDocs - My Docs
Screenshot 2022-06-26 at 12-51-52 Welcome to MkDocs - My Docs
Screenshot 2022-06-26 at 13-10-28 Home - Cinder

Fixes #104.

@chrissimpkins
Copy link
Owner

Looks fantastic! Will you please explain how you are approaching the default and how one toggles between light and dark mode?

@azmeuk
Copy link
Author

azmeuk commented Jun 30, 2022

Generally, the system (Linux, MacOS, Windows, Android) has a dark/light preferences, that is passed to the browser. Depending on that preference, the browser will select properties to apply depending on prefers-color-scheme. There are ways to force a given mode in a browser with extensions like Dark reader.

At the moment cinder theme can only be switched by triggering that option from the browser, or the system.

What do you mean by approaching the default?

@chrissimpkins
Copy link
Owner

chrissimpkins commented Jul 5, 2022

What do you mean by approaching the default?

I think that I misunderstood what you intended to support. So this automatically uses the user system setting for content theme. Is there a way to make this opt-in through our configuration in case existing users who upgrade want to keep the light mode color scheme for all users, irrespective of their system dark mode toggle setting?

@azmeuk
Copy link
Author

azmeuk commented Jul 5, 2022

So this automatically uses the user system setting for content theme.

Yes.

Is there a way to make this opt-in through our configuration in case existing users who upgrade want to keep the light mode color scheme for all users, irrespective of their system dark mode toggle setting?

Ok I'll have a look on how to do this.

@azmeuk
Copy link
Author

azmeuk commented Jul 18, 2022

@chrissimpkins before I tackle this, there might be another option to consider: we could display a switch that would toggle between light, dark, or system mode. Something like this. What do you think?

@chrissimpkins
Copy link
Owner

@chrissimpkins before I tackle this, there might be another option to consider: we could display a switch that would toggle between light, dark, or system mode. Something like this. What do you think?

Sure, let's try it. I'm interested to see what you have in mind.

Anyone out there who happens to be following this repo opposed?

@NotActuallyTerry
Copy link

Hello! A switch as described there, defaulting to System Default, feels like the way to go for implementing on-page control.

@chrissimpkins
Copy link
Owner

Hello! A switch as described there, defaulting to System Default, feels like the way to go for implementing on-page control.

Sgtm!

@fralfaro
Copy link

Hello, is this light/dark mode issue still valid?

@azmeuk
Copy link
Author

azmeuk commented Oct 12, 2023

I think so, I just cannot find anytime to improve the PR, so this probably need someone to pick it up!

@NotActuallyTerry
Copy link

From the looks of it, the feature got added in 60ae931 but this PR didn't get closed

@azmeuk
Copy link
Author

azmeuk commented Oct 13, 2023

Strangely this commit is neither in the master or dev branch:
Screenshot 2023-10-13 at 15-55-28 Implement Dark Variant · chrissimpkins_cinder@60ae931

@azmeuk azmeuk closed this Jul 30, 2024
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.

Dark variant
4 participants