mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
fix(panel): make font-scale visibly resize all tables/charts and raise readable base sizes
- Raise base typography tokens (data tables to 12.5px, body/titles to 13px) above CJK 12px floor and widen lg (1.14x) / xl (1.28x) scale steps - Replace 19 hardcoded px font-size rules across tables, charts, tooltips, heatmaps, and monthly bars with scalable --fs-* tokens - Bind [data-font-scale] directly in CSS and mirror onto Shadow DOM overlay panels without colliding with :host defaults - Convert rigid control/row pixel heights to scalable min-heights and scale floating panel base widths on lg/xl
This commit is contained in:
@@ -17,8 +17,15 @@ export const THEME_ACCENT_PRESETS = Object.freeze([
|
||||
export const FONT_SCALE_FACTORS = Object.freeze({
|
||||
sm: 0.92,
|
||||
md: 1,
|
||||
lg: 1.08,
|
||||
xl: 1.15,
|
||||
lg: 1.14,
|
||||
xl: 1.28,
|
||||
});
|
||||
|
||||
export const PANEL_SCALE_FACTORS = Object.freeze({
|
||||
sm: 1,
|
||||
md: 1,
|
||||
lg: 1.09,
|
||||
xl: 1.18,
|
||||
});
|
||||
|
||||
export function normalizeClientThemeAccent(raw) {
|
||||
@@ -70,10 +77,13 @@ export function applyAppearanceToRoot(targetEl, settings, { includeFontScale = t
|
||||
if (includeFontScale) {
|
||||
const scaleKey = normalizeClientFontScale(settings?.fontScale);
|
||||
const factor = FONT_SCALE_FACTORS[scaleKey] ?? 1;
|
||||
const panelFactor = PANEL_SCALE_FACTORS[scaleKey] ?? 1;
|
||||
setOrClearStyleVar(targetEl, '--ui-font-scale', factor === 1 ? '' : String(factor));
|
||||
setOrClearStyleVar(targetEl, '--ui-panel-scale', panelFactor === 1 ? '' : String(panelFactor));
|
||||
targetEl.setAttribute?.('data-font-scale', scaleKey);
|
||||
} else {
|
||||
setOrClearStyleVar(targetEl, '--ui-font-scale', '');
|
||||
setOrClearStyleVar(targetEl, '--ui-panel-scale', '');
|
||||
if (typeof targetEl.removeAttribute === 'function') {
|
||||
targetEl.removeAttribute('data-font-scale');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user