refactor(webui): establish offline typography foundations
Remove runtime requests to external font services and make the default sans and monospace stacks rely entirely on locally available platform fonts. Introduce explicit metadata and micro text tokens for dense technical content, disable synthetic font faces globally, and update the appearance selector so every bundled font choice accurately describes its local source.
This commit is contained in:
3 files changed
+16
-11
No files matched your search
@@ -49,9 +49,6 @@
|
|||||||
} catch (e) { /* ignore — fall back to default theme */ }
|
} catch (e) { /* ignore — fall back to default theme */ }
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&family=Noto+Sans+SC:wght@400;500;600;700&display=swap" rel="stylesheet" />
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -66,15 +66,15 @@ export const POLL_INTERVAL_OPTIONS = [
|
|||||||
export interface FontSpec { id: string; label: string; stack: string }
|
export interface FontSpec { id: string; label: string; stack: string }
|
||||||
|
|
||||||
export const FONT_SANS_OPTIONS: FontSpec[] = [
|
export const FONT_SANS_OPTIONS: FontSpec[] = [
|
||||||
{ id: 'default', label: '默认 (Inter)', stack: "'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif" },
|
{ id: 'default', label: '默认(本地系统)', stack: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif" },
|
||||||
{ id: 'system', label: '系统界面', stack: "system-ui, -apple-system, 'Segoe UI', 'Noto Sans SC', sans-serif" },
|
{ id: 'system', label: '平台原生', stack: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" },
|
||||||
{ id: 'rounded', label: '圆润', stack: "'Varela Round', 'Quicksand', 'Noto Sans SC', system-ui, sans-serif" },
|
{ id: 'rounded', label: '圆润(平台字体)', stack: "ui-rounded, 'SF Pro Rounded', system-ui, sans-serif" },
|
||||||
{ id: 'serif', label: '衬线', stack: "Georgia, 'Songti SC', 'Noto Serif SC', serif" },
|
{ id: 'serif', label: '衬线(本地字体)', stack: "Georgia, 'Songti SC', 'STSong', serif" },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const FONT_MONO_OPTIONS: FontSpec[] = [
|
export const FONT_MONO_OPTIONS: FontSpec[] = [
|
||||||
{ id: 'default', label: '默认 (JetBrains)', stack: "'JetBrains Mono', 'Fira Code', ui-monospace, monospace" },
|
{ id: 'default', label: '默认(系统等宽)', stack: "ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace" },
|
||||||
{ id: 'system', label: '系统等宽', stack: "ui-monospace, 'SF Mono', Menlo, Consolas, monospace" },
|
{ id: 'system', label: '平台等宽', stack: "ui-monospace, Menlo, Consolas, monospace" },
|
||||||
];
|
];
|
||||||
|
|
||||||
export interface GradientSpec { id: string; label: string; css: string }
|
export interface GradientSpec { id: string; label: string; css: string }
|
||||||
|
|||||||
@@ -150,8 +150,15 @@
|
|||||||
--radius-lg: var(--radius);
|
--radius-lg: var(--radius);
|
||||||
--radius-xl: calc(var(--radius) + 4px);
|
--radius-xl: calc(var(--radius) + 4px);
|
||||||
|
|
||||||
--font-sans: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
|
--font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
|
||||||
--font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
|
--font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
|
||||||
|
|
||||||
|
/* Dense metadata is the only content allowed below Tailwind's 12px text-xs
|
||||||
|
floor. Named tokens make that exception explicit at each call site. */
|
||||||
|
--text-meta: 0.6875rem;
|
||||||
|
--text-meta--line-height: 1rem;
|
||||||
|
--text-micro: 0.625rem;
|
||||||
|
--text-micro--line-height: 0.875rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
@@ -166,6 +173,7 @@
|
|||||||
background-color: var(--background);
|
background-color: var(--background);
|
||||||
color: var(--foreground);
|
color: var(--foreground);
|
||||||
font-family: var(--font-sans);
|
font-family: var(--font-sans);
|
||||||
|
font-synthesis: none;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
|||||||
Reference in new issue
Block a user