feat: resolve all 22 items in Features and Bugs.txt and complete UI polish
This commit is contained in:
+630
-166
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* Font families per theme. See PLAN.md §4.7.
|
||||
* System fonts only — no network fetches.
|
||||
* UI chrome is locked to System Sans across all themes so typography changes
|
||||
* only affect the writing editor surface.
|
||||
*/
|
||||
|
||||
export interface FontSet {
|
||||
/** UI chrome font. */
|
||||
/** UI chrome font (locked to System Sans). */
|
||||
ui: string;
|
||||
/** Body / prose font. */
|
||||
body: string;
|
||||
@@ -12,24 +13,27 @@ export interface FontSet {
|
||||
mono: string;
|
||||
}
|
||||
|
||||
export const SYSTEM_UI_FONT =
|
||||
"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif";
|
||||
|
||||
export const FONTS: Record<string, FontSet> = {
|
||||
ink: {
|
||||
ui: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
|
||||
ui: SYSTEM_UI_FONT,
|
||||
body: "Georgia, 'Times New Roman', serif",
|
||||
mono: "'SFMono-Regular', ui-monospace, 'Cascadia Code', Consolas, monospace",
|
||||
},
|
||||
parchment: {
|
||||
ui: "Georgia, 'Times New Roman', serif",
|
||||
ui: SYSTEM_UI_FONT,
|
||||
body: "Georgia, 'Times New Roman', serif",
|
||||
mono: "'SFMono-Regular', ui-monospace, Consolas, monospace",
|
||||
},
|
||||
nocturne: {
|
||||
ui: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
|
||||
ui: SYSTEM_UI_FONT,
|
||||
body: "Georgia, 'Times New Roman', serif",
|
||||
mono: "'SFMono-Regular', ui-monospace, 'Cascadia Code', Consolas, monospace",
|
||||
},
|
||||
terminal: {
|
||||
ui: "'SFMono-Regular', ui-monospace, 'Cascadia Code', Consolas, monospace",
|
||||
ui: SYSTEM_UI_FONT,
|
||||
body: "'SFMono-Regular', ui-monospace, Consolas, monospace",
|
||||
mono: "'SFMono-Regular', ui-monospace, Consolas, monospace",
|
||||
},
|
||||
|
||||
@@ -166,3 +166,15 @@ export function applyFontSettings(s: Partial<FontSettings>): void {
|
||||
if (s.measure != null) root.style.setProperty("--ps-font-measure", `${s.measure}px`);
|
||||
if (s.family != null && s.family !== "") root.style.setProperty("--ps-font-body", s.family);
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply UI density ("compact" | "comfortable") by setting `data-density` on
|
||||
* `:root` and updating `--ps-density` and `--ps-topbar-h`.
|
||||
*/
|
||||
export function applyDensity(density: "compact" | "comfortable"): void {
|
||||
const root = typeof document !== "undefined" ? document.documentElement : undefined;
|
||||
if (!root) return;
|
||||
root.dataset.density = density;
|
||||
root.style.setProperty("--ps-density", density === "compact" ? "8px" : "14px");
|
||||
root.style.setProperty("--ps-topbar-h", density === "compact" ? "40px" : "48px");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user