Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(web): strengthen editor bold text across platforms

tianma-ifab49f2e06acf
diff --git a/apps/web/src/styles/editor-themes/minimal-emerald.css b/apps/web/src/styles/editor-themes/minimal-emerald.css
index d16f1fdf..dd481a22 100644
--- a/apps/web/src/styles/editor-themes/minimal-emerald.css
+++ b/apps/web/src/styles/editor-themes/minimal-emerald.css
@@ -70,7 +70,7 @@
.edgeever-editor[data-editor-theme="minimal-emerald"]:not([data-editor-theme="default"]) .ProseMirror strong {
color: var(--editor-theme-heading);
- font-weight: 600;
+ font-weight: 700;
}
.edgeever-editor[data-editor-theme="minimal-emerald"]:not([data-editor-theme="default"]) .ProseMirror a {
diff --git a/apps/web/src/styles/editor-themes/outline-emerald.css b/apps/web/src/styles/editor-themes/outline-emerald.css
index 03032eac..98fcd8ce 100644
--- a/apps/web/src/styles/editor-themes/outline-emerald.css
+++ b/apps/web/src/styles/editor-themes/outline-emerald.css
@@ -72,7 +72,7 @@
.edgeever-editor[data-editor-theme="outline-emerald"]:not([data-editor-theme="default"]) .ProseMirror strong {
color: var(--editor-theme-heading);
- font-weight: 600;
+ font-weight: 700;
}
.edgeever-editor[data-editor-theme="outline-emerald"]:not([data-editor-theme="default"]) .ProseMirror a {
diff --git a/apps/web/src/styles/editor-typography.test.mjs b/apps/web/src/styles/editor-typography.test.mjs
index 13b2256f..9482a955 100644
--- a/apps/web/src/styles/editor-typography.test.mjs
+++ b/apps/web/src/styles/editor-typography.test.mjs
@@ -34,6 +34,23 @@ describe("editor typography contract", () => {
expect(markdownLinkRules).toMatch(/text-decoration\s*:\s*underline/);
});
+ test("keeps bold text visibly distinct across platform font fallbacks", () => {
+ const globals = readStyle("./globals.css");
+ const defaultBoldRules = declarationsForSelector(globals, ".ProseMirror strong");
+
+ expect(defaultBoldRules).toMatch(/font-synthesis\s*:\s*weight/);
+ expect(defaultBoldRules).toMatch(/font-weight\s*:\s*800/);
+
+ for (const filename of PRESET_THEME_FILES) {
+ const source = readStyle(`./editor-themes/${filename}`);
+ const boldRules = declarationsForSelector(source, ".ProseMirror strong");
+ const weights = [...boldRules.matchAll(/font-weight\s*:\s*(\d+)/g)].map((match) => Number(match[1]));
+
+ expect(weights.length).toBeGreaterThan(0);
+ expect(Math.max(...weights)).toBeGreaterThanOrEqual(700);
+ }
+ });
+
test("does not let preset themes override body rhythm", () => {
for (const filename of PRESET_THEME_FILES) {
const source = readStyle(`./editor-themes/${filename}`);
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index 9e9fabe5..fcb67028 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -455,6 +455,15 @@ textarea {
padding: 0;
}
+/* Do not rely on the browser's relative `bolder` mapping here. Linux Chrome
+ * can render CJK fallback fonts with too little contrast between regular and
+ * bold, especially when the installed family has no matching bold face. */
+.ProseMirror strong,
+.ProseMirror b {
+ font-synthesis: weight;
+ font-weight: 800;
+}
+
/* External hyperlinks (default theme).
* Tailwind preflight resets <a> to inherit color/decoration, so without this
* rule links are indistinguishable from body text. Note/attachment chips below