Closed pryrt closed 7 months ago
Notes to self:
config.toml
add:
[params]
# (Optional, default light) Sets color theme: light, dark or auto.
# Theme 'auto' switches between dark and light modes based on browser/os preferences
BookTheme = 'auto'
[markup.goldmark.renderer]
unsafe= true
<KBD>
dropshadow, use the var(...)
syntax, and the variable names defined in the @mixins
sections of ...\assets\_defaults.scss
:
/* drop shadow */
-moz-box-shadow: 1px 1px 10px 1px var(--gray-500);
-webkit-box-shadow: 1px 1px 10px 1px var(--gray-500);
box-shadow: 1px 1px 10px 1px var(--gray-500);
@mixins
is to edit ...\assets\_defaults.scss
: I was hoping to avoid editing anything but _custom.scss
, but might have to stick with that...
While thinking on #653, I was reminded that at one point, someone had requested the User Manual switch to Dark Mode, which I wasn't going to do, because there are still plenty of people who prefer light mode. But #653 reminded me about that, and I started searching for whether there's a way to have a hugo-based site automatically or manually switch from Dark to Light (auto = depends on browser settings).
The conclusion of https://github.com/alex-shpak/hugo-book/issues/151 does indicate that the feature has been added as the parameter
BookTheme: auto|dark|light
. I will have to experiment to see if that really works, and whether I can import the updated book theme without affecting our customizations (as far as I can tell, only_custom.scss
has been updated since we started 2019... but I don't know what else might have been customized before the first commit)If I get that to work, I will want to make sure anything from #653 and from my earlier
<KBD>
-styling, will look right under both light and dark.