Recovering from something that broke the styling. It is not 100% right, but much better.

This commit is contained in:
Scott Idem
2024-08-23 14:26:17 -04:00
parent fed37a77b8
commit 4dbdd16bd0
8 changed files with 176 additions and 193 deletions

View File

@@ -8,9 +8,9 @@ import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
let notes: null|string = null;
let all: boolean = false;
export let theme_mode: null|string = null;
// export let theme_mode: null|string = null;
export let set_theme_mode: null|boolean = null;
export let theme_name: null|string = null;
// export let theme_name: null|string = null;
export let set_theme_name: null|boolean = null;
const dispatch = createEventDispatcher();
@@ -26,8 +26,8 @@ onMount(() => {
}
});
$: if ($slct_trigger == 'set_theme_mode' && $ae_loc.hub.theme_mode) {
console.log(`$ae_loc.hub.theme_mode=${$ae_loc.hub.theme_mode}`);
$: if ($slct_trigger == 'set_theme_mode' && $ae_loc?.hub?.theme_mode) {
console.log(`$ae_loc.hub.theme_mode=${$ae_loc?.hub?.theme_mode}`);
$slct_trigger = null;
if ($ae_loc.hub.theme_mode == 'light') {
document.documentElement.classList.remove('dark');
@@ -38,11 +38,11 @@ $: if ($slct_trigger == 'set_theme_mode' && $ae_loc.hub.theme_mode) {
}
}
$: if ($slct_trigger == 'set_theme_name' && $ae_loc.hub.theme_name) {
console.log(`$ae_loc.hub.theme_name=${$ae_loc.hub.theme_name}`);
$: if ($slct_trigger == 'set_theme_name' && $ae_loc?.hub?.theme_name) {
console.log(`$ae_loc?.hub?.theme_name=${$ae_loc?.hub?.theme_name}`);
$slct_trigger = null;
// Update the body attribute named "data-theme" to the current theme name.
document.body.setAttribute('data-theme', $ae_loc.hub.theme_name);
document.body.setAttribute('data-theme', $ae_loc?.hub?.theme_name);
}
// $: if (entered_passcode && entered_passcode.length >= 5) {