Refactor the theme initialization script to use 'const' instead of 'let'
for the 'currentTheme' variable, as the value is not expected to change
after initialization.
This makes the code more clear and prevents accidental
re-assignment.
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
- Use `get_url` function to generate correct image paths
- Retrieve image dimensions with `get_image_metadata` function
- Update shortcodes: dimmable_image, dual_theme_image, and invertible_image
These changes reduce layout shifts.
Reduces contrast and brightness of images when the dark theme is active.
Useful when invertable-image is not appropriate (photographs, paintings,
colour drawings…)
Update the theme switcher code to set the default theme to the OS
default, rather than the "light" theme. This provides a more seamless
user experience for users whose OS is set to a dark mode. The current
theme setting in local storage will still be respected if present. This
change was made to improve the accessibility and usability.
Fixes#38