Honor Obsidian task font size

This commit is contained in:
callumalpass 2026-05-18 05:34:28 +10:00
parent f854323d97
commit 4e86cb8fbb
3 changed files with 29 additions and 7 deletions

View file

@ -135,6 +135,7 @@ Example:
- ([#1219](https://github.com/callumalpass/tasknotes/issues/1219)) Fixed Kanban drags that start on an expanded subtask card so they move that subtask instead of dragging the parent card. Thanks to @craziedde for reporting this.
- ([#990](https://github.com/callumalpass/tasknotes/issues/990)) Treated one-item status lists written by Obsidian Properties as the same status value in TaskNotes Kanban, so they no longer create duplicate columns. Thanks to @mlevison for reporting this.
- ([#983](https://github.com/callumalpass/tasknotes/issues/983)) Let Agenda Calendar views wrap their header controls and task titles inside narrow sidebars, so Today and refresh controls and task icons remain visible without sideways scrolling. Thanks to @3zra47 for reporting this.
- ([#982](https://github.com/callumalpass/tasknotes/issues/982)) Made TaskNotes task-card typography scale from Obsidian's text font size setting, so Bases and Agenda task text follows larger mobile font settings. Thanks to @3zra47 for suggesting this and @chrsdk and @scottaltham-payroc for the follow-up.
- ([#1213](https://github.com/callumalpass/tasknotes/issues/1213)) Fixed embedded Task List Bases in Obsidian pop-out windows so typing below the embed no longer leaves a large blank gap. Thanks to @same774 for reporting this.
- ([#1243](https://github.com/callumalpass/tasknotes/issues/1243)) Removed quoted multi-word custom field NLP expressions from created task titles after saving the custom field value. Thanks to @Arachnidai for reporting this.
- ([#1252](https://github.com/callumalpass/tasknotes/issues/1252)) Hardened the calendar-first task date picker for iPad taps so date buttons use direct touch manipulation. Thanks to @alxandrharris for reporting this.

View file

@ -296,15 +296,16 @@
--tn-nested-task-padding: 15px;
/* ================================================
SCOPED TYPOGRAPHY SYSTEM (inherit from design system)
SCOPED TYPOGRAPHY SYSTEM
================================================ */
--tn-font-size-xs: var(--cs-text-label-small);
--tn-font-size-sm: var(--cs-text-label-medium);
--tn-font-size-md: var(--cs-text-body-medium);
--tn-font-size-lg: var(--cs-text-body-large);
--tn-font-size-xl: var(--cs-text-title-medium);
--tn-font-size-2xl: var(--cs-text-title-large);
--tn-font-size-base: var(--font-text-size, 16px);
--tn-font-size-xs: calc(var(--tn-font-size-base) * 0.625);
--tn-font-size-sm: calc(var(--tn-font-size-base) * 0.6875);
--tn-font-size-md: calc(var(--tn-font-size-base) * 0.75);
--tn-font-size-lg: calc(var(--tn-font-size-base) * 0.875);
--tn-font-size-xl: calc(var(--tn-font-size-base) * 0.875);
--tn-font-size-2xl: calc(var(--tn-font-size-base) * 1.125);
/* Typography weights and styles */
--tn-font-weight-normal: 400;

View file

@ -0,0 +1,20 @@
import fs from "fs";
import path from "path";
const repoRoot = path.resolve(__dirname, "../../..");
function readRepoFile(relativePath: string): string {
return fs.readFileSync(path.join(repoRoot, relativePath), "utf-8");
}
describe("Issue #982: Obsidian text font size inheritance", () => {
it("derives TaskNotes typography tokens from Obsidian's text font size setting", () => {
const css = readRepoFile("styles/variables.css");
expect(css).toContain("--tn-font-size-base: var(--font-text-size, 16px)");
expect(css).toContain("--tn-font-size-xs: calc(var(--tn-font-size-base) * 0.625)");
expect(css).toContain("--tn-font-size-md: calc(var(--tn-font-size-base) * 0.75)");
expect(css).toContain("--tn-font-size-lg: calc(var(--tn-font-size-base) * 0.875)");
expect(css).toContain("--tn-font-size-2xl: calc(var(--tn-font-size-base) * 1.125)");
});
});