diff --git a/src-svelte/Makefile b/src-svelte/Makefile index 873eab4e..1e5b844a 100644 --- a/src-svelte/Makefile +++ b/src-svelte/Makefile @@ -18,7 +18,7 @@ update-local-screenshots: cp -r screenshots/local/testing/actual/* screenshots/baseline/ quick-test: - yarn vitest --pool=forks --exclude src/routes/storybook.test.ts run + yarn vitest --pool=forks --exclude src/routes/storybook.test.ts test: yarn test diff --git a/src-svelte/src/lib/InfoBox.svelte b/src-svelte/src/lib/InfoBox.svelte index d93b4d09..1eb27f5b 100644 --- a/src-svelte/src/lib/InfoBox.svelte +++ b/src-svelte/src/lib/InfoBox.svelte @@ -244,7 +244,12 @@ import getComponentId from "./label-id"; import RoundDef from "./RoundDef.svelte"; import { cubicInOut, cubicOut, linear } from "svelte/easing"; - import { animationSpeed, animationsOn, transparencyOn } from "./preferences"; + import { + animationSpeed, + animationsOn, + transparencyOn, + getAdjustedFontSize, + } from "./preferences"; import { fade, type TransitionConfig } from "svelte/transition"; import { firstAppLoad, firstPageLoad } from "./firstPageLoad"; import { SubAnimation, PropertyAnimation } from "$lib/animation-timing"; @@ -267,7 +272,7 @@ const parentNode = node.parentNode as Element; const actualWidth = parentNode.clientWidth; const actualHeight = parentNode.clientHeight; - const heightPerTitleLinePx = 26; + const heightPerTitleLinePx = getAdjustedFontSize(26); const titleHeight = (titleElement as HTMLElement).clientHeight; // multiply by 1.3 to account for small pixel differences between browsers const titleIsMultiline = titleHeight > heightPerTitleLinePx * 1.3; diff --git a/src-svelte/src/lib/Slider.svelte b/src-svelte/src/lib/Slider.svelte index 27d6b04f..2cfa41ee 100644 --- a/src-svelte/src/lib/Slider.svelte +++ b/src-svelte/src/lib/Slider.svelte @@ -6,14 +6,12 @@ type DragOptions, type DragEventData, } from "@neodrag/svelte"; + import { ROOT_EM } from "./preferences"; - const rootFontSize = parseFloat( - getComputedStyle(document.documentElement).fontSize, - ); const sliderId = getComponentId("slider"); const transitionAnimation = `transition: ` + `transform var(--standard-duration) ease-out;`; - const overshoot = 0.4 * rootFontSize; // how much overshoot to allow per-side + const overshoot = 0.4 * ROOT_EM; // how much overshoot to allow per-side export let label: string | undefined = undefined; export let min = 0; diff --git a/src-svelte/src/lib/Switch.svelte b/src-svelte/src/lib/Switch.svelte index fff7e3fc..0835a35e 100644 --- a/src-svelte/src/lib/Switch.svelte +++ b/src-svelte/src/lib/Switch.svelte @@ -10,7 +10,7 @@