mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-24 07:53:09 +00:00
fix(appearance): scale inline px font sizes so text-size reaches all content
The global text-size control only set the root font-size, which scales rem-based text (navbar, menus) but not the dense inline px sizes used across the trip planner, budget, journey and panels — so place titles and addresses stayed fixed. applyAppearance now also exposes the factor as --fs-scale-text, and a codemod wraps inline numeric fontSize in calc(<px> * var(--fs-scale-text, 1)) across components and pages (map popups and PDF excluded). Sizes are byte-identical at 100%; the control now visibly resizes the actual content.
This commit is contained in:
@@ -141,9 +141,16 @@ export function applyAppearance(input: ApplyAppearanceInput): AppearanceConfig {
|
||||
setScaleVar(root, '--fs-scale-body', eff.typeScale.body)
|
||||
setScaleVar(root, '--fs-scale-caption', eff.typeScale.caption)
|
||||
|
||||
// global font scale — coarse accessibility knob; root font-size drives all rem text.
|
||||
if (eff.fontScale === 1) root.style.removeProperty('font-size')
|
||||
else root.style.fontSize = `${eff.fontScale * 100}%`
|
||||
// global font scale: root font-size scales rem-based text; --fs-scale-text
|
||||
// scales the (migrated) inline px sizes so dense content (trip places,
|
||||
// addresses, panels) scales too. Both are driven by the same factor.
|
||||
if (eff.fontScale === 1) {
|
||||
root.style.removeProperty('font-size')
|
||||
root.style.removeProperty('--fs-scale-text')
|
||||
} else {
|
||||
root.style.fontSize = `${eff.fontScale * 100}%`
|
||||
root.style.setProperty('--fs-scale-text', String(eff.fontScale))
|
||||
}
|
||||
|
||||
// theme-color meta — unchanged from before (dark #09090b / light #ffffff).
|
||||
const meta = document.querySelector('meta[name="theme-color"]')
|
||||
|
||||
Reference in New Issue
Block a user