bookish-press 0.4.231 → 0.4.232

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,13 +39,17 @@ $: {
39
39
  document.body.classList.remove('dark');
40
40
  if (typeof localStorage !== 'undefined')
41
41
  localStorage.setItem('dark', $darkMode ? 'true' : 'false');
42
+ // Set the theme, whatever it is, and change it when the edition changes
43
+ setTheme(edition.getTheme() ?? BookishTheme);
42
44
  }
43
45
  }
46
+ // Set the theme on mount.
47
+ onMount(() => {
48
+ setTheme(edition.getTheme() ?? BookishTheme);
49
+ });
44
50
  // Redirect old hash routes by simply replacing their hash before routing.
45
51
  if (typeof window !== 'undefined' && window.location.hash.startsWith('#/'))
46
52
  goto(location.hash.replace('#', ''));
47
- // Set the theme, whatever it is, and change it when the edition changes.
48
- $: setTheme(edition.getTheme() ?? BookishTheme);
49
53
  /** Given a theme, sets the appropriate CSS rules in the browser to apply the theme.*/
50
54
  function setTheme(theme) {
51
55
  // If the theme is being unset, make sure we've removed any overrding style declaration.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bookish-press",
3
3
  "private": false,
4
- "version": "0.4.231",
4
+ "version": "0.4.232",
5
5
  "type": "module",
6
6
  "description": "A platform for reading and writing readable, accessible, beautiful online books.",
7
7
  "license": "MIT",