feat: density token and root font size for size modes (T1-T4)

Compact, Normal and Large scale the text (13/14/16px) and the control
heights (32/40/48px) via data-size on <html>. Normal is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-15 09:16:40 +02:00
co-authored by Claude Opus 5.5
parent dc927062a3
commit 9a04f94118
5 changed files with 46 additions and 39 deletions
+7
View File
@@ -71,4 +71,11 @@
--md-sys-elevation-level3: 0 1px 3px rgb(0 0 0 / 30%), 0 4px 8px 3px rgb(0 0 0 / 15%);
--md-sys-elevation-level4: 0 2px 3px rgb(0 0 0 / 30%), 0 6px 10px 4px rgb(0 0 0 / 15%);
--md-sys-elevation-level5: 0 4px 4px rgb(0 0 0 / 30%), 0 8px 12px 6px rgb(0 0 0 / 15%);
/* Size mode (theme.js sets data-size): added to control heights, e.g. calc(40px + var(--nm-density)) */
--nm-density: 0px;
}
/* Text is in rem, so the root size scales it; percent keeps the browser's font setting */
:root[data-size="compact"] { font-size: 92.857%; --nm-density: -8px; } /* 13px body, M3 density -2 */
:root[data-size="large"] { font-size: 114.286%; --nm-density: 8px; } /* 16px body */