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

Darkmode for single file #90

Closed
wants to merge 6 commits into from
Closed

Conversation

olibu
Copy link
Contributor

@olibu olibu commented May 10, 2024

Support for dark mode in single file.
CSS is not modified any more. Themes are based on css conditions instead.
Darkmode is activated earlier now, because pages has flickered on when triggered in index.js

@lapo-luchini
Copy link
Owner

Thanks! This closes #89.

@@ -1,10 +1,12 @@
<!DOCTYPE html>
<html>
<html data-theme="dark">
Copy link
Owner

Choose a reason for hiding this comment

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

@olibu is this necessary?
(and it is correct when OS theme is light? or would cause flickering on the other way?)

Copy link
Owner

Choose a reason for hiding this comment

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

Thinking about it, I'd say it's fine as it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I verified it in dark and light mode to work without flickering. However, I set dark as the default. When testing I recognized that the dark flash is not as disturbing as the light flash.
Flickering stopped by separating the function into the theme.js

@lapo-luchini
Copy link
Owner

I transplanted your changes to a new branch (should be 1:1 and in your name).

@lapo-luchini
Copy link
Owner

Merged in f03d403.

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.

2 participants