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

Add dark mode #65

Merged
merged 20 commits into from
May 5, 2022
Merged

Add dark mode #65

merged 20 commits into from
May 5, 2022

Conversation

lberki
Copy link
Contributor

@lberki lberki commented Mar 26, 2022

Saves state in local storage, integrates with the OS level dark mode preference (I think), is nicely animated, I even took care that syntax highlighting results in more subdued colors.

This branch is currently on top of the table of contents one because that one defines an extra color, so I found it convenient to work on top of it. There were also a number of undesirable interactions between the two, so I feel vindicated in my decision to test the two together.

Lukacs T. Berki added 19 commits March 25, 2022 04:09
It can be enabled using the `toc: true` field in the frontmatter.

It auto-expands on hover. If JS is enabled, the expansion is
animated. The animation is apparently impossible to implement
without JS :(

On mobile, expands and unexpands on tap instead of hover.
Why this works is a mystery, but it sure does.
That means: a little HTML template, a JS file plus some CSS to
make the icon appear roughly properly.
Except in _syntax.scss. That will be annoying. Eventually, I
I should also figure out what that file is for.
Implement nice transitions, add first version of dark color
scheme, merge with other transitions properly.
This is ugly, but the RGB values are generated server side so some
workaround had to be found.
Only when the toggle button is actually clicked.
This makes the default background color not flash for a split
second after the page is loaded.
The relationship of `z-index:` and `filter:` is complicated.
This required a little refactoring of the code, but it hopefully
became more robust this way.
@lberki
Copy link
Contributor Author

lberki commented May 4, 2022

(friendly ping)

@EmielH EmielH merged commit 776f966 into EmielH:master May 5, 2022
@EmielH EmielH mentioned this pull request May 5, 2022
cloudlena pushed a commit to cloudlena/tale-hugo that referenced this pull request Feb 10, 2024
Add dark mode

See EmielH#65
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.

None yet

2 participants