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): tint checked task boxes with the note palette

tianma-if4cae94daa39f
diff --git a/apps/web/src/lib/wechat-copy.ts b/apps/web/src/lib/wechat-copy.ts
index fb551420..df6f6c9e 100644
--- a/apps/web/src/lib/wechat-copy.ts
+++ b/apps/web/src/lib/wechat-copy.ts
@@ -105,6 +105,12 @@ const applyLegacyWeChatStyles = (
root.querySelectorAll<HTMLElement>("pre code").forEach((element) => {
element.style.cssText = `padding: 0; background: transparent; color: inherit; font-family: Menlo, Consolas, monospace; font-size: ${codeSize}; white-space: pre-wrap;`;
});
+
+ if (colors?.accent) {
+ root.querySelectorAll<HTMLElement>('ul[data-type="taskList"] li[data-checked] > label input').forEach((element) => {
+ element.style.accentColor = colors.accent;
+ });
+ }
};
const applyInlineStyles = (
diff --git a/apps/web/src/styles/editor-typography.test.mjs b/apps/web/src/styles/editor-typography.test.mjs
index 209006c7..596afd25 100644
--- a/apps/web/src/styles/editor-typography.test.mjs
+++ b/apps/web/src/styles/editor-typography.test.mjs
@@ -81,12 +81,14 @@ describe("editor typography contract", () => {
expect(prose).not.toContain('data-note-palette="custom"');
});
- test("named palettes recolor links, inline code, and bold", () => {
+ test("named palettes recolor links, inline code, bold, and checked task boxes", () => {
const prose = readStyle("./note-prose.css");
expect(prose).toMatch(/color:\s*var\(--note-palette-link\)/);
expect(prose).toMatch(/color:\s*var\(--note-palette-code-text\)/);
expect(prose).toMatch(/color:\s*var\(--note-palette-accent\)/);
+ expect(prose).toMatch(/accent-color:\s*var\(--note-palette-accent\)/);
+ expect(prose).toMatch(/ul\[data-type="taskList"\] li\[data-checked\] > label input/);
expect(prose).toMatch(/\.edgeever-code-block code/);
expect(prose).not.toMatch(/--note-palette-text/);
expect(prose).not.toMatch(/--note-palette-surface/);
diff --git a/apps/web/src/styles/note-prose.css b/apps/web/src/styles/note-prose.css
index 59a9e39a..cd3a590d 100644
--- a/apps/web/src/styles/note-prose.css
+++ b/apps/web/src/styles/note-prose.css
@@ -1,4 +1,4 @@
-/* Named hues tint links, inline code, and bold. Body, quotes, rules, tables, and code chrome stay native. */
+/* Named hues tint links, inline code, bold, and checked task boxes. Body, quotes, rules, tables, and code chrome stay native. */
.edgeever-editor[data-note-palette]:not([data-note-palette="native"]) .ProseMirror a:not(.edgeever-attachment-link) {
color: var(--note-palette-link);
text-decoration-color: color-mix(in srgb, var(--note-palette-link) 45%, transparent);
@@ -14,6 +14,10 @@
color: var(--note-palette-accent);
}
+.edgeever-editor[data-note-palette]:not([data-note-palette="native"]) .ProseMirror ul[data-type="taskList"] li[data-checked] > label input {
+ accent-color: var(--note-palette-accent);
+}
+
.edgeever-editor[data-note-palette]:not([data-note-palette="native"]) .ProseMirror code {
color: var(--note-palette-code-text);
}
diff --git a/docs/editor-typography-plan.zh-CN.md b/docs/editor-typography-plan.zh-CN.md
index 0ee866cb..bd77f8d6 100644
--- a/docs/editor-typography-plan.zh-CN.md
+++ b/docs/editor-typography-plan.zh-CN.md
@@ -61,7 +61,7 @@
笔记正文字体维持现状:本机选择,内置字体仍可发布到公开分享页,自定义字体名称不发布。
-正文配色放在「阅读」里,用固定选项,不用滑杆。默认是现在的原生配色。另外 9 款按色相分开,每款差一个大色相。选中一款时,只改链接、行内代码和粗体,粗体用该款强调色。正文、标题、引用、分隔线、表格、代码底和代码边框仍用原生。深色模式同样只改这三项,链接和行内代码用强调色。界面、侧栏、工具栏、图表和信息图不跟着变。
+正文配色放在「阅读」里,用固定选项,不用滑杆。默认是现在的原生配色。另外 9 款按色相分开,每款差一个大色相。选中一款时,只改链接、行内代码、粗体和待办勾选框,粗体和勾选框用该款强调色。空框和划掉的文字仍用原生。正文、标题、引用、分隔线、表格、代码底和代码边框仍用原生。深色模式同样只改这几项,链接和行内代码用强调色。界面、侧栏、工具栏、图表和信息图不跟着变。
原先那 10 款里,琥珀和日暖都是金黄,夜蓝和青页都是蓝,雾色和青玉都是青,林绿又接近品牌绿。这四款舍弃。空出来的位置用酒红,再补色相上没有的橙色和粉色。绿色曾放进选项,后来去掉。设置里的名字直接用色名。