Prevent font size flash on settings change
This commit is contained in:
parent
c88a981fb6
commit
c5403f786f
2 changed files with 8 additions and 4 deletions
|
|
@ -58,6 +58,7 @@
|
||||||
--sair: var(--safe-area-inset-right, env(safe-area-inset-right));
|
--sair: var(--safe-area-inset-right, env(safe-area-inset-right));
|
||||||
|
|
||||||
text-size-adjust: 100%;
|
text-size-adjust: 100%;
|
||||||
|
font-size: 110%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import "@lib/components/theme.css"
|
import "@lib/components/theme.css"
|
||||||
import "@welshman/editor/index.css"
|
import "@welshman/editor/index.css"
|
||||||
|
import {debounce} from "throttle-debounce"
|
||||||
import * as nip19 from "nostr-tools/nip19"
|
import * as nip19 from "nostr-tools/nip19"
|
||||||
import type {Unsubscriber} from "svelte/store"
|
import type {Unsubscriber} from "svelte/store"
|
||||||
import {get} from "svelte/store"
|
import {get} from "svelte/store"
|
||||||
|
|
@ -272,10 +273,12 @@
|
||||||
document.body.setAttribute("data-theme", $theme)
|
document.body.setAttribute("data-theme", $theme)
|
||||||
document.body.setAttribute("data-fl-theme", env.FL_THEME)
|
document.body.setAttribute("data-fl-theme", env.FL_THEME)
|
||||||
}),
|
}),
|
||||||
userSettingsValues.subscribe($userSettingsValues => {
|
userSettingsValues.subscribe(
|
||||||
// @ts-ignore
|
debounce(100, $userSettingsValues => {
|
||||||
document.documentElement.style["font-size"] = `${$userSettingsValues.font_size}rem`
|
// @ts-ignore
|
||||||
}),
|
document.documentElement.style["font-size"] = `${$userSettingsValues.font_size}rem`
|
||||||
|
}),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
return () => unsubscribers.forEach(call)
|
return () => unsubscribers.forEach(call)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue