mirror of
https://github.com/welpo/tabi.git
synced 2025-10-11 07:46:15 +02:00
🐛 fix: remove flash when navigating in dark-mode
The `initialize-theme.js` script takes care of the following: 1. If there is a stored theme value in the localStorage, set the theme based on that value. 2. If there is no stored theme value, check the user's system preference (dark or light) and set the theme accordingly. The new `main.js` takes care of the actual theme switching and listening to system preference changes (if the user has not manually set a theme). Now the icons are stored in CSS, and are set according to the current theme. This allows for having different icons that dynamically switch. Additionally, wraps social and navigation elements in ul/li. Fixes #76
This commit is contained in:
parent
eb63718bbf
commit
1efb0330e3
15 changed files with 64 additions and 85 deletions
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
title = "Almost no JavaScript"
|
||||
date = 2023-01-06
|
||||
updated = 2023-04-15
|
||||
updated = 2023-04-28
|
||||
description = "JavaScript is only used when HTML and CSS aren't enough."
|
||||
|
||||
[taxonomies]
|
||||
|
@ -10,8 +10,8 @@ tags = ["showcase"]
|
|||
|
||||
# JavaScript?
|
||||
|
||||
This theme has almost no JavaScript. It includes a ~950 byte `.js` file with the logic for the light/dark mode switch which can be disabled by setting `theme_switcher = false` in the `config.toml` file.
|
||||
This theme has almost no JavaScript. It includes ~900 bytes of `.js` with the logic for the light/dark mode switch, which can be disabled by setting `theme_switcher = false` in the `config.toml` file.
|
||||
|
||||
KaTex support, which requires JavaScript, can be activated for specific posts.
|
||||
KaTex support, which requires loading a 274 KB JavaScript file, can be activated for specific posts.
|
||||
|
||||
Other than that, it's a fast site with HTML and CSS. Just the way (most of) the web should be :-)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue