
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
603 B
603 B
+++ title = "Almost no JavaScript" date = 2023-01-06 updated = 2023-04-28 description = "JavaScript is only used when HTML and CSS aren't enough."
[taxonomies] tags = ["showcase"] +++
JavaScript?
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 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 :-)