The theme toggle button now has a third option, which follows the user's
system preferences.
- In the code there's now a distinction between the theme setting (which
can be "dark", "light" or "system") and the computed theme.
- The theme setting is now stored as the "theme-setting" local storage
variable. Since this is different from the old variable ("theme"), this
will effectively reset all current user themes to the default "system".
Maybe this is not what you want.
- The "system" theme icon is currently a half circle symbol.
- The toggle button now displays the current theme setting, rather than
the next theme setting (as far as I know this is consistent with other
sites which have three theme options).
- `theme.js` is now loaded regardless of `site.enable_darkmode`. This is
because other scripts which were always loaded relied on being able to
determine the theme. `theme.js` no longer initialises the theme itself
though; this only happens when `site.enable_darkmode`.
- When the theme setting is "system", the theme will change immediately
whenever the user changes their system theme.
#2261
---------
Signed-off-by: George Araujo <george.gcac@gmail.com>
Co-authored-by: George Araujo <george.gcac@gmail.com>
summary:
- adds prettier formatter configuration
- formats the entire repo using prettier, ignoring minified files
(`*.min.css`) and heavy generated html
- changes extensions of all `.html` files to `.liquid`, which is more
correct and necessary for prettier to work correctly
- replaces "%-" and "-%" with just "%" — manual liquid formatting using
minus signs is superfluous since we are compressing and minifying the
code anyway
- adds CI action for running prettier check on PR and pushes to master
* Add support for github repo cards
* add support for dark theme
* Add support for custom theme
* repositories
* fix
* make it simpler
* spcaing
* responsive fix
* adds support for usernames
* make it modular
* fix
* show icons
* cache_seconds
* fix
* Revert "cache_seconds"
This reverts commit a9dd4d5d43d212676e1c1dba8ec8086c7fdb7cd7.
* add last line
* fix
* github only
* fix
* Add instructions
* Add `README.md` instructions
* Add `nav_order`
* Dark Mode + Theming
* Themes scss file created with default color scheme and dark color scheme.
* Logic for managing dark mode toggle added.
* Modified existing scss/html to work with theme toggling.
* Fixed hover issues
* Added enable_darkmode to configs.
* Added the requested option of disabling/enabling dark mode via config files.