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

Switch light / dark theme based on user preference and CSS feature prefers-color-scheme #133

Open
ashwinvis opened this issue Apr 9, 2020 · 3 comments
Labels
laterz Will get resolved eventually, but not now.

Comments

@ashwinvis
Copy link

Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme

How practical would it be to have an optional light / dark color scheme?

@mosra
Copy link
Owner

mosra commented Jan 5, 2022

(Sorry for embarrassingly late replies, finally got a chance to get back to this project.)

Technically, this is actually very doable, as most of the styling is derived from seven base colors (default, primary, info, success, warning, danger, dim) and all content including code highlighting and embedded SVG like math equations, graphs or plots follows that.

Practically, the light "theme" I have here is very rudimentary and half-assed 😅 So before implementing this I would have to make sure the two themes complement each other and there aren't any glaring omissions or contrast/accessibility issues in the light version. Not sure when I will be able to get to that (especially given my two-year absence in this project maintenance) but it's definitely something nice to have.

EDIT: Oh -- I like the theme you have on your page. Very nice, and unlike mine, consistent between the light and dark version :)

@ashwinvis
Copy link
Author

Thanks... I did try to iron out some accessibility issues, but still, there might be many imperfections. There is a bit of work to extract only the theme related changes from my fork.

The latest version of my theme is available at https://codeberg.org/ashwinvis/m.css for now if anyone is interested.

@mosra mosra added the laterz Will get resolved eventually, but not now. label Jan 6, 2022
@rommeswi
Copy link

rommeswi commented May 6, 2024

Perhaps a first attempt could simply be a color inversion filter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
laterz Will get resolved eventually, but not now.
Development

No branches or pull requests

3 participants