Skip to content

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

feat(editor): refine cross-platform content layout

tianma-if9057a82a3f09
diff --git a/apps/ios/EditorSource/src/styles.css b/apps/ios/EditorSource/src/styles.css
index 1776ff6d..b84df308 100644
--- a/apps/ios/EditorSource/src/styles.css
+++ b/apps/ios/EditorSource/src/styles.css
@@ -1,6 +1,6 @@
:root {
color-scheme: light dark;
- --accent: #19ac73;
+ --accent: #16a06e;
--text: #0f172a;
--muted: #64748b;
--border: #f1f5f9;
@@ -214,6 +214,12 @@ html[data-theme="dark"] body {
margin-bottom: 0;
}
+.ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div > p {
+ color: var(--placeholder);
+ text-decoration: line-through;
+ transition: color 150ms ease, text-decoration 150ms ease;
+}
+
.ProseMirror ul[data-type="taskList"] ul[data-type="taskList"] {
margin: 4px 0 0;
padding-left: 24px;
@@ -422,9 +428,20 @@ html[data-theme="dark"] .edgeever-image-size-button.is-active {
color: #99f6e4;
}
+.edgeever-prose code,
+.ProseMirror code {
+ border: 1px solid var(--border);
+ border-radius: 4px;
+ background: var(--code-bg);
+ padding: 2px 4px;
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
+ font-size: 0.9em;
+}
+
.edgeever-prose pre,
.ProseMirror pre {
background: var(--code-bg);
+ border: 1px solid var(--border);
padding: 10px 12px;
border-radius: 8px;
overflow-x: auto;
@@ -495,24 +512,121 @@ html[data-theme="dark"] .ProseMirror hr[data-edgeever-merge-divider] {
.edgeever-prose blockquote,
.ProseMirror blockquote {
margin: 0.5em 0;
- padding-left: 12px;
+ padding: 6px 12px;
border-left: 3px solid var(--accent);
- color: var(--muted);
+ border-radius: 1px 4px 4px 1px;
+ background: color-mix(in srgb, var(--accent) 4%, transparent);
+ color: #334155;
+}
+
+html[data-theme="dark"] .edgeever-prose blockquote,
+html[data-theme="dark"] .ProseMirror blockquote {
+ background: color-mix(in srgb, var(--accent) 7%, transparent);
+ color: #cbd5e1;
+}
+
+.edgeever-prose .tableWrapper,
+.ProseMirror .tableWrapper {
+ --mobile-table-column-width: clamp(4.5rem, 24cqi, 12rem);
+ container-type: inline-size;
+ display: block;
+ width: 100%;
+ max-width: 100%;
+ min-width: 0;
+ overflow-x: auto;
+ overflow-y: hidden;
+ -webkit-overflow-scrolling: touch;
+ margin: 10px 0;
+ border: 1px solid var(--border);
+ border-radius: 6px;
+ background: var(--toolbar-bg);
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.edgeever-prose table,
.ProseMirror table {
- border-collapse: collapse;
+ border-collapse: separate;
+ border-spacing: 0;
width: 100%;
- margin: 8px 0;
+ min-width: 100%;
+ max-width: none;
+ table-layout: fixed;
+}
+
+.edgeever-prose table:has(> colgroup > col:first-child:last-child),
+.ProseMirror table:has(> colgroup > col:first-child:last-child) {
+ --mobile-table-column-width: 100cqi;
+}
+
+.edgeever-prose table:has(> colgroup > col:first-child:nth-last-child(2)),
+.ProseMirror table:has(> colgroup > col:first-child:nth-last-child(2)) {
+ --mobile-table-column-width: 50cqi;
+}
+
+.edgeever-prose table:has(> colgroup > col:first-child:nth-last-child(3)),
+.ProseMirror table:has(> colgroup > col:first-child:nth-last-child(3)) {
+ --mobile-table-column-width: calc(100cqi / 3);
+}
+
+.edgeever-prose table:has(> colgroup > col:first-child:nth-last-child(4)),
+.ProseMirror table:has(> colgroup > col:first-child:nth-last-child(4)) {
+ --mobile-table-column-width: 25cqi;
+}
+
+.edgeever-prose table:has(> colgroup > col:first-child:nth-last-child(n+5)),
+.ProseMirror table:has(> colgroup > col:first-child:nth-last-child(n+5)) {
+ width: max-content;
+ --mobile-table-column-width: clamp(4.5rem, 24cqi, 10rem);
+}
+
+.edgeever-prose table:not(:has(colgroup)),
+.ProseMirror table:not(:has(colgroup)) {
+ table-layout: auto;
+ width: 100%;
+ min-width: 100%;
+}
+
+.edgeever-prose table col,
+.ProseMirror table col {
+ width: var(--mobile-table-column-width) !important;
+ min-width: var(--mobile-table-column-width) !important;
+}
+
+.edgeever-prose th,
+.ProseMirror th {
+ background: var(--code-bg);
+ font-weight: 600;
}
.edgeever-prose th,
.edgeever-prose td,
.ProseMirror th,
.ProseMirror td {
- border: 1px solid var(--border);
+ position: relative;
+ width: var(--mobile-table-column-width, auto);
+ min-width: var(--mobile-table-column-width, 3.5rem);
+ border: 0;
+ border-right: 1px solid var(--border);
+ border-bottom: 1px solid var(--border);
padding: 6px 8px;
+ text-align: left;
+ vertical-align: top;
+ white-space: normal;
+ overflow-wrap: anywhere;
+ word-break: break-word;
+ line-height: 1.4;
+}
+
+.edgeever-prose th:last-child,
+.edgeever-prose td:last-child,
+.ProseMirror th:last-child,
+.ProseMirror td:last-child {
+ border-right: 0;
+}
+
+.edgeever-prose tr:last-child td,
+.ProseMirror tr:last-child td {
+ border-bottom: 0;
}
.edgeever-prose h1,
diff --git a/apps/mobile/src/components/LocalTiptapEditor.tsx b/apps/mobile/src/components/LocalTiptapEditor.tsx
index aba067e3..2929d720 100644
--- a/apps/mobile/src/components/LocalTiptapEditor.tsx
+++ b/apps/mobile/src/components/LocalTiptapEditor.tsx
@@ -2930,14 +2930,15 @@ const getEditorStyles = (theme: "light" | "dark", options?: { viewer?: boolean }
.edgeever-editor-content ul[data-type="taskList"] { margin: 0 0 var(--editor-paragraph-spacing); padding-left: 0; list-style: none; }
.edgeever-editor-content ul[data-type="taskList"] li[data-checked] { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0; }
.edgeever-editor-content ul[data-type="taskList"] li[data-checked] > label { display: inline-flex; flex: 0 0 auto; align-items: center; margin-top: 3px; user-select: none; }
- .edgeever-editor-content ul[data-type="taskList"] li[data-checked] > label input { width: 18px; height: 18px; margin: 0; accent-color: #16a06e; }
+ .edgeever-editor-content ul[data-type="taskList"] li[data-checked] > label input { width: 18px; height: 18px; margin: 0; border-radius: 3px; accent-color: #16a06e; }
.edgeever-editor-content ul[data-type="taskList"] li[data-checked] > div { min-width: 0; flex: 1 1 auto; }
.edgeever-editor-content ul[data-type="taskList"] li[data-checked] > div > p { margin-bottom: 0; }
+ .edgeever-editor-content ul[data-type="taskList"] li[data-checked="true"] > div > p { color: #94a3b8; text-decoration: line-through; }
.edgeever-editor-content ul[data-type="taskList"] ul[data-type="taskList"] { margin: 4px 0 0; padding-left: 24px; }
- .edgeever-editor-content blockquote { margin-left: 0; max-width: 100%; padding-left: 14px; border-left: 3px solid #5eead4; color: ${theme === "dark" ? "#cbd5e1" : "#475569"}; }
- .edgeever-editor-content pre { max-width: 100%; overflow-x: auto; border-radius: 10px; padding: 14px 90px 14px 14px; background: #0f172a; color: #e2e8f0; font-size: 0.9rem; }
- .edgeever-editor-content code { border-radius: 4px; padding: 2px 4px; background: ${theme === "dark" ? "#1e293b" : "#f1f5f9"}; font-size: 0.9em; }
- .edgeever-editor-content pre code { padding: 0; background: transparent; font-size: inherit; }
+ .edgeever-editor-content blockquote { margin-left: 0; max-width: 100%; padding: 6px 12px; border-left: 3px solid #16a06e; border-radius: 1px 4px 4px 1px; background: ${theme === "dark" ? "rgba(22, 160, 110, 0.08)" : "rgba(22, 160, 110, 0.04)"}; color: ${theme === "dark" ? "#cbd5e1" : "#334155"}; }
+ .edgeever-editor-content pre { max-width: 100%; overflow-x: auto; border-radius: 8px; border: 1px solid ${theme === "dark" ? "#334155" : "#e2e8f0"}; padding: 12px 90px 12px 14px; background: ${theme === "dark" ? "#1e293b" : "#f8fafc"}; color: ${theme === "dark" ? "#e2e8f0" : "#0f172a"}; font-size: 0.88rem; box-shadow: 0 1px 2px ${theme === "dark" ? "rgba(0, 0, 0, 0.2)" : "rgba(15, 23, 42, 0.03)"}; }
+ .edgeever-editor-content code { border-radius: 4px; padding: 2px 5px; border: 1px solid ${theme === "dark" ? "rgba(255,255,255,0.1)" : "#e2e8f0"}; background: ${theme === "dark" ? "#1e293b" : "#f1f5f9"}; color: ${theme === "dark" ? "#e2e8f0" : "#0f172a"}; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }
+ .edgeever-editor-content pre code { padding: 0; border: 0; background: transparent; font-size: inherit; }
.edgeever-editor-content .tiptap-mathematics-render[data-type="block-math"] { max-width: 100%; margin: 16px 0; overflow-x: auto; overflow-y: hidden; padding: 4px 0; text-align: center; -webkit-overflow-scrolling: touch; }
.edgeever-editor-content .inline-math-error, .edgeever-editor-content .block-math-error { color: ${theme === "dark" ? "#fda4af" : "#be123c"}; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* External hyperlinks (match Web default ProseMirror). Attachment chips override below. */
@@ -3025,9 +3026,10 @@ const getEditorStyles = (theme: "light" | "dark", options?: { viewer?: boolean }
margin-right: 0;
margin-bottom: 20px;
margin-left: 0;
- border: 1px solid ${theme === "dark" ? "#334155" : "#d8d8d8"};
- border-radius: 2px;
+ border: 1px solid ${theme === "dark" ? "#334155" : "#e2e8f0"};
+ border-radius: 6px;
background: ${theme === "dark" ? "#0f172a" : "#fff"};
+ box-shadow: 0 1px 3px ${theme === "dark" ? "rgba(0, 0, 0, 0.2)" : "rgba(15, 23, 42, 0.03)"};
overscroll-behavior-inline: contain;
scrollbar-width: thin;
scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
@@ -3040,7 +3042,7 @@ const getEditorStyles = (theme: "light" | "dark", options?: { viewer?: boolean }
background: rgba(100, 116, 139, 0.4);
}
.edgeever-editor-content table {
- width: max-content;
+ width: 100%;
max-width: none;
min-width: 100%;
border-collapse: separate;
@@ -3062,6 +3064,15 @@ const getEditorStyles = (theme: "light" | "dark", options?: { viewer?: boolean }
.edgeever-editor-content table:has(> colgroup > col:first-child:nth-last-child(4)) {
--mobile-table-column-width: 25cqi;
}
+ .edgeever-editor-content table:has(> colgroup > col:first-child:nth-last-child(n+5)) {
+ width: max-content;
+ --mobile-table-column-width: clamp(4.25rem, 24cqi, 10rem);
+ }
+ .edgeever-editor-content table:not(:has(colgroup)) {
+ table-layout: auto;
+ width: 100%;
+ min-width: 100%;
+ }
/* Override TipTap/desktop col widths with the mobile equal-ish column budget. */
.edgeever-editor-content table col {
width: var(--mobile-table-column-width) !important;
@@ -3069,12 +3080,12 @@ const getEditorStyles = (theme: "light" | "dark", options?: { viewer?: boolean }
}
.edgeever-editor-content th, .edgeever-editor-content td {
position: relative;
- width: var(--mobile-table-column-width);
- min-width: var(--mobile-table-column-width);
- max-width: var(--mobile-table-column-width);
+ width: var(--mobile-table-column-width, auto);
+ min-width: var(--mobile-table-column-width, 3.5rem);
+ max-width: var(--mobile-table-column-width, none);
border: 0;
- border-right: 1px solid ${theme === "dark" ? "#334155" : "#dedede"};
- border-bottom: 1px solid ${theme === "dark" ? "#334155" : "#dedede"};
+ border-right: 1px solid ${theme === "dark" ? "#334155" : "#e2e8f0"};
+ border-bottom: 1px solid ${theme === "dark" ? "#334155" : "#e2e8f0"};
padding: 6px 8px;
text-align: left;
vertical-align: top;
@@ -3084,11 +3095,11 @@ const getEditorStyles = (theme: "light" | "dark", options?: { viewer?: boolean }
line-height: 1.4;
transition: background-color 120ms ease;
}
- .edgeever-editor-content th { background: ${theme === "dark" ? "#27303f" : "#f0f0f0"}; color: ${theme === "dark" ? "#f8fafc" : "#111827"}; font-size: 0.93rem; font-weight: 700; }
+ .edgeever-editor-content th { background: ${theme === "dark" ? "#1e293b" : "#f8fafc"}; color: ${theme === "dark" ? "#f8fafc" : "#0f172a"}; font-size: 0.93rem; font-weight: 600; }
.edgeever-editor-content th:last-child, .edgeever-editor-content td:last-child { border-right: 0; }
.edgeever-editor-content tr:last-child td { border-bottom: 0; }
- .edgeever-editor-content tbody tr:nth-child(even) td { background: ${theme === "dark" ? "#182235" : "#f8f8f8"}; }
- .edgeever-editor-content tbody tr:hover td { background: ${theme === "dark" ? "#202b3d" : "#f3f4f6"}; }
+ .edgeever-editor-content tbody tr:nth-child(even) td { background: ${theme === "dark" ? "rgba(15, 23, 42, 0.6)" : "#fafafa"}; }
+ .edgeever-editor-content tbody tr:hover td { background: ${theme === "dark" ? "#1e293b" : "#f1f5f9"}; }
.edgeever-editor-content th p, .edgeever-editor-content td p { margin: 0; }
.edgeever-editor-content .selectedCell::after { position: absolute; inset: 0; content: ""; pointer-events: none; background: rgba(16, 185, 129, 0.14); }
.edgeever-image-upload-placeholder { position: relative; max-width: 100%; min-height: 112px; margin: 14px auto; overflow: hidden; border-radius: 10px; background: ${theme === "dark" ? "#1e293b" : "#f1f5f9"}; }
diff --git a/apps/mobile/src/screens/workspace-styles.ts b/apps/mobile/src/screens/workspace-styles.ts
index 845583a7..0f9a5dde 100644
--- a/apps/mobile/src/screens/workspace-styles.ts
+++ b/apps/mobile/src/screens/workspace-styles.ts
@@ -743,7 +743,7 @@ const baseWorkspaceStyles = StyleSheet.create({
memoCard: {
alignItems: "stretch",
backgroundColor: "#ffffff",
- borderColor: "#f1f5f9",
+ borderColor: "#e2e8f0",
borderRadius: 8,
borderWidth: 1,
flexDirection: "row",
@@ -757,15 +757,15 @@ const baseWorkspaceStyles = StyleSheet.create({
},
memoCardSelected: {
backgroundColor: "#f8fafc",
- borderColor: "#e2e8f0",
+ borderColor: "#cbd5e1",
},
memoCardContent: {
flex: 1,
minWidth: 0,
- padding: 16,
+ padding: 15,
},
memoCardContentCompact: {
- padding: 13,
+ padding: 12,
},
memoCardContentWithSelection: {
paddingLeft: 12,
@@ -797,7 +797,7 @@ const baseWorkspaceStyles = StyleSheet.create({
memoTitle: {
color: "#0f172a",
flex: 1,
- fontSize: 16,
+ fontSize: 15,
fontWeight: "700",
},
memoPinnedStar: {
@@ -807,33 +807,35 @@ const baseWorkspaceStyles = StyleSheet.create({
width: 16,
},
memoExcerpt: {
- color: "#0f172a",
- fontSize: 14,
- lineHeight: 20,
- marginTop: 8,
- minHeight: 40,
+ color: "#475569",
+ fontSize: 13,
+ lineHeight: 19,
+ marginTop: 6,
+ minHeight: 38,
},
memoMeta: {
alignItems: "center",
flexDirection: "row",
flexWrap: "wrap",
gap: 8,
- marginTop: 20,
+ marginTop: 14,
},
memoMetaCompact: {
- marginTop: 8,
+ marginTop: 6,
},
memoDate: {
- color: "#334155",
+ color: "#64748b",
fontSize: 12,
- fontWeight: "500",
+ fontWeight: "400",
},
tag: {
- backgroundColor: "#f1f5f9",
- borderRadius: 2,
- color: "#0f172a",
- fontSize: 12,
- fontWeight: "500",
+ backgroundColor: "#ecfdf5",
+ borderColor: "#a7f3d0",
+ borderRadius: 3,
+ borderWidth: 1,
+ color: "#047857",
+ fontSize: 11,
+ fontWeight: "600",
overflow: "hidden",
paddingHorizontal: 6,
paddingVertical: 2,
diff --git a/apps/web/src/components/EditorPane.tsx b/apps/web/src/components/EditorPane.tsx
index 136aca35..4917c63b 100644
--- a/apps/web/src/components/EditorPane.tsx
+++ b/apps/web/src/components/EditorPane.tsx
@@ -4399,7 +4399,7 @@ const RichEditorPane = ({
</div>
</div>
- <div className="space-y-3 px-4 pb-4 pt-4 sm:px-7 lg:space-y-0 lg:pb-0.5 lg:pt-1.5">
+ <div className="space-y-1.5 px-4 pb-2.5 pt-2.5 sm:space-y-3 sm:px-7 sm:pb-4 sm:pt-4 lg:space-y-0 lg:pb-0.5 lg:pt-1.5">
<input
value={title}
readOnly={effectiveReadOnly}
@@ -4408,12 +4408,12 @@ const RichEditorPane = ({
persistCurrentDraft(event.target.value, tagsText, getMobilePlainTextValue());
markDirty();
}}
- className="block w-full rounded-md border-0 bg-transparent text-2xl font-bold leading-tight text-slate-950 outline-none transition placeholder:text-slate-300 focus-visible:bg-muted focus-visible:shadow-[inset_3px_0_0_var(--brand-green)] sm:text-[26px]"
+ className="block w-full rounded-md border-0 bg-transparent text-xl font-bold leading-snug text-slate-950 outline-none transition placeholder:text-slate-300 focus-visible:bg-muted focus-visible:shadow-[inset_3px_0_0_var(--brand-green)] sm:text-2xl lg:text-[26px]"
placeholder={t("common.untitledMemo")}
/>
- <div className="flex flex-wrap items-center gap-2">
+ <div className="flex flex-wrap items-center gap-1.5 sm:gap-2">
<button
- className="flex h-8 min-w-0 max-w-full items-center gap-1 rounded-md border border-transparent bg-transparent px-2 text-sm font-medium text-slate-600 outline-none transition hover:border-slate-200 hover:bg-slate-50 hover:text-slate-900 focus-visible:border-emerald-300 focus-visible:ring-2 focus-visible:ring-emerald-500/20 disabled:opacity-50 sm:hidden"
+ className="flex h-7 min-w-0 max-w-full items-center gap-1 rounded-md border border-transparent bg-transparent px-1.5 text-xs font-medium text-slate-600 outline-none transition hover:border-slate-200 hover:bg-slate-50 hover:text-slate-900 focus-visible:border-emerald-300 focus-visible:ring-2 focus-visible:ring-emerald-500/20 disabled:opacity-50 sm:hidden"
type="button"
disabled={effectiveReadOnly || notebookUpdatePending}
title={t("editor.currentNotebook")}
@@ -4683,7 +4683,7 @@ const RichEditorPane = ({
"flex gap-8 transition-all duration-200",
useMarkdownSourceEditor
? "h-full min-h-0 flex-1 items-stretch px-0 py-0"
- : "min-h-full items-start px-6 py-4 sm:px-10",
+ : "min-h-full items-start px-4 py-2 sm:px-7 lg:px-10",
desktopFocusMode
? "mx-auto w-full max-w-[1400px] justify-center"
: editorContentAlignment === "center"
diff --git a/apps/web/src/components/EditorTagPicker.tsx b/apps/web/src/components/EditorTagPicker.tsx
index fb095a64..354e9224 100644
--- a/apps/web/src/components/EditorTagPicker.tsx
+++ b/apps/web/src/components/EditorTagPicker.tsx
@@ -151,7 +151,7 @@ export const EditorTagPicker = ({ contentMarkdown, disabled, loadTags, title, va
<button
type="button"
disabled={disabled}
- className="flex h-8 min-w-0 max-w-[32rem] items-center gap-1.5 rounded-md border border-transparent px-2 text-left text-sm text-slate-500 outline-none transition hover:border-slate-200 hover:bg-slate-50 focus-visible:border-emerald-300 focus-visible:ring-2 focus-visible:ring-emerald-500/15 disabled:opacity-50"
+ className="flex h-7 min-w-0 max-w-[32rem] items-center gap-1 rounded-md border border-transparent px-1.5 text-left text-xs text-slate-500 outline-none transition hover:border-slate-200 hover:bg-slate-50 focus-visible:border-emerald-300 focus-visible:ring-2 focus-visible:ring-emerald-500/15 disabled:opacity-50 sm:h-8 sm:gap-1.5 sm:px-2 sm:text-sm"
aria-label={t("editor.tagPicker.open")}
onClick={() => setOpen(true)}
>
@@ -160,13 +160,13 @@ export const EditorTagPicker = ({ contentMarkdown, disabled, loadTags, title, va
{selectedTags.slice(0, 3).map((tag) => (
<span
key={tag}
- className="rounded-sm border border-emerald-200/70 bg-emerald-50/70 px-1.5 py-0.5 text-xs font-medium text-emerald-800 transition-colors dark:border-emerald-800/50 dark:bg-emerald-950/40 dark:text-emerald-300"
+ className="rounded-sm border border-emerald-200/70 bg-emerald-50/70 px-1.5 py-0.5 text-[11px] font-medium text-emerald-800 transition-colors dark:border-emerald-800/50 dark:bg-emerald-950/40 dark:text-emerald-300 sm:text-xs"
>
#{tag}
</span>
))}
{selectedTags.length > 3 && (
- <span className="text-xs font-medium text-slate-400">+{selectedTags.length - 3}</span>
+ <span className="text-[11px] font-medium text-slate-400 sm:text-xs">+{selectedTags.length - 3}</span>
)}
</span>
) : (
@@ -182,20 +182,20 @@ export const EditorTagPicker = ({ contentMarkdown, disabled, loadTags, title, va
type="button"
disabled={disabled || suggesting || selectedTags.length >= 24 || (!title.trim() && !contentMarkdown.trim())}
className={aiStatus.kind === "error"
- ? "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-rose-700 outline-none transition hover:bg-rose-50 focus-visible:ring-2 focus-visible:ring-rose-500/20 disabled:opacity-50"
+ ? "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-rose-700 outline-none transition hover:bg-rose-50 focus-visible:ring-2 focus-visible:ring-rose-500/20 disabled:opacity-50 sm:h-8 sm:w-8"
: aiStatus.kind === "success"
- ? "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-emerald-50 text-emerald-700 outline-none transition focus-visible:ring-2 focus-visible:ring-emerald-500/20 disabled:opacity-50"
- : "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-emerald-700 outline-none transition hover:bg-emerald-50 focus-visible:ring-2 focus-visible:ring-emerald-500/20 disabled:opacity-50"}
+ ? "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-emerald-50 text-emerald-700 outline-none transition focus-visible:ring-2 focus-visible:ring-emerald-500/20 disabled:opacity-50 sm:h-8 sm:w-8"
+ : "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-emerald-700 outline-none transition hover:bg-emerald-50 focus-visible:ring-2 focus-visible:ring-emerald-500/20 disabled:opacity-50 sm:h-8 sm:w-8"}
aria-label={aiDescription}
onClick={() => void generateAndApplyTags()}
>
{suggesting
- ? <Loader2 className="h-4 w-4 animate-spin" />
+ ? <Loader2 className="h-3.5 w-3.5 animate-spin sm:h-4 sm:w-4" />
: aiStatus.kind === "success"
- ? <Check className="h-4 w-4" />
+ ? <Check className="h-3.5 w-3.5 sm:h-4 sm:w-4" />
: aiStatus.kind === "error"
- ? <CircleAlert className="h-4 w-4" />
- : <TagPlus className="h-4 w-4" />}
+ ? <CircleAlert className="h-3.5 w-3.5 sm:h-4 sm:w-4" />
+ : <TagPlus className="h-3.5 w-3.5 sm:h-4 sm:w-4" />}
</button>
</TooltipTrigger>
<TooltipContent side="bottom">{aiDescription}</TooltipContent>
diff --git a/apps/web/src/components/MemoCard.tsx b/apps/web/src/components/MemoCard.tsx
index fd2f1f9b..c6671a3c 100644
--- a/apps/web/src/components/MemoCard.tsx
+++ b/apps/web/src/components/MemoCard.tsx
@@ -323,7 +323,7 @@ export const MemoCard = ({
>
{!selectionMode && selected ? (
<m.span
- className="pointer-events-none absolute inset-y-3 left-0 z-10 hidden w-[3px] origin-center rounded-r-full bg-emerald-500 lg:block"
+ className="pointer-events-none absolute inset-y-2.5 left-0 z-10 hidden w-[3px] origin-center rounded-r-full bg-emerald-500 shadow-[0_0_8px_rgba(22,160,110,0.35)] lg:block"
aria-hidden="true"
{...selectionSettleMotion}
/>
@@ -356,8 +356,8 @@ export const MemoCard = ({
)}
<button
className={cn(
- "min-w-0 flex-1 px-4 py-4 text-left touch-pan-y focus-visible:bg-slate-50 focus-visible:shadow-[inset_3px_0_0_rgb(148,163,184)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-slate-400/60 [-webkit-touch-callout:none] lg:py-4 transition-all duration-200",
- listDensity === "compact" && "py-3",
+ "min-w-0 flex-1 px-4 py-3.5 text-left touch-pan-y focus-visible:bg-slate-50 focus-visible:shadow-[inset_3px_0_0_rgb(148,163,184)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-slate-400/60 [-webkit-touch-callout:none] lg:py-3.5 transition-all duration-200",
+ listDensity === "compact" && "py-2.5",
showSelectionControl && "pl-3 lg:pl-3",
!isTrashView && !multiSelectKeyDown && "lg:cursor-grab lg:active:cursor-grabbing",
multiSelectKeyDown && "cursor-copy"
@@ -376,26 +376,26 @@ export const MemoCard = ({
onKeyDown={handleKeyDown}
title={t("memoCard.interactionHint")}
>
- <div className={cn("mb-2 flex min-w-0 items-center gap-1.5 text-base font-semibold leading-6 text-slate-950 lg:text-base", listDensity === "compact" && "mb-1")}>
+ <div className={cn("mb-1.5 flex min-w-0 items-center gap-1.5 text-[15px] font-semibold tracking-[-0.012em] leading-snug text-slate-950", listDensity === "compact" && "mb-0.5 text-[14px]")}>
{memo.isPinned && <Star className="h-4 w-4 shrink-0 fill-amber-400 text-amber-500" />}
<span className="min-w-0 truncate">{memoTitle}</span>
</div>
<div
className={cn(
- "line-clamp-2 min-h-10 text-sm leading-5 text-slate-950",
- listDensity === "compact" && "line-clamp-1 min-h-0 text-[13px]"
+ "line-clamp-2 min-h-10 text-[13px] leading-relaxed text-slate-600 dark:text-slate-400",
+ listDensity === "compact" && "line-clamp-1 min-h-0 text-[12.5px]"
)}
>
{memoExcerpt}
</div>
- <div className={cn("mt-5 flex flex-wrap items-center gap-2", listDensity === "compact" && "mt-2")}>
- <time className="text-xs font-medium text-slate-800 lg:text-sm lg:font-normal lg:text-slate-800">
+ <div className={cn("mt-3.5 flex flex-wrap items-center gap-2", listDensity === "compact" && "mt-1.5")}>
+ <time className="text-xs font-normal text-slate-500 dark:text-slate-400">
{formatMemoPreviewDate(memo.updatedAt, i18n.resolvedLanguage ?? i18n.language, t("memoCard.yesterday"))}
</time>
{memo.tags.slice(0, 3).map((tag) => (
<span
key={tag}
- className="rounded-sm border border-emerald-200/70 bg-emerald-50/70 px-1.5 py-0.5 text-xs font-medium text-emerald-800 transition-colors dark:border-emerald-800/50 dark:bg-emerald-950/40 dark:text-emerald-300"
+ className="rounded-[3px] border border-emerald-200/60 bg-emerald-50/60 px-1.5 py-0.5 text-[11px] font-medium tracking-tight text-emerald-800 transition-colors dark:border-emerald-800/40 dark:bg-emerald-950/30 dark:text-emerald-300"
>
#{tag}
</span>
diff --git a/apps/web/src/lib/table-layout.test.mjs b/apps/web/src/lib/table-layout.test.mjs
new file mode 100644
index 00000000..8a091a16
--- /dev/null
+++ b/apps/web/src/lib/table-layout.test.mjs
@@ -0,0 +1,33 @@
+import { describe, expect, test } from "bun:test";
+import { readFileSync } from "node:fs";
+
+const globals = readFileSync(new URL("../styles/globals.css", import.meta.url), "utf8");
+const mobileEditor = readFileSync(new URL("../styles/mobile-markdown-editor.css", import.meta.url), "utf8");
+
+describe("responsive table layout contracts", () => {
+ test("globals.css provides container-query proportional column widths for compact tables", () => {
+ expect(globals).not.toContain("min-width: 42rem !important;");
+ expect(globals).not.toContain("calc((100vw - 3rem) / 3)");
+ expect(globals).toContain(".ProseMirror .tableWrapper");
+ expect(globals).toContain("container-type: inline-size;");
+ expect(globals).toContain("--mobile-table-column-width: 100cqi;");
+ expect(globals).toContain("--mobile-table-column-width: 50cqi;");
+ expect(globals).toContain("--mobile-table-column-width: calc(100cqi / 3);");
+ expect(globals).toContain("--mobile-table-column-width: 25cqi;");
+ });
+
+ test("mobile-markdown-editor.css provides container-query proportional column widths", () => {
+ expect(mobileEditor).not.toContain("calc((100vw - 3rem) / 3)");
+ expect(mobileEditor).toContain("container-type: inline-size;");
+ expect(mobileEditor).toContain("--mobile-table-column-width: 100cqi;");
+ expect(mobileEditor).toContain("--mobile-table-column-width: 50cqi;");
+ expect(mobileEditor).toContain("--mobile-table-column-width: calc(100cqi / 3);");
+ expect(mobileEditor).toContain("--mobile-table-column-width: 25cqi;");
+ });
+
+ test("wide tables with 5+ columns expand and scroll smoothly inside wrapper", () => {
+ expect(globals).toContain(".tableWrapper {\n --mobile-table-column-width: clamp(4.5rem, 24cqi, 12rem);");
+ expect(globals).toMatch(/\.ProseMirror \.tableWrapper[\s\S]*?overflow-x: auto;/);
+ expect(mobileEditor).toMatch(/\.edgeever-mobile-tiptap-content \.tableWrapper[\s\S]*?overflow-x: auto;/);
+ });
+});
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index e8a23240..595fe221 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -263,6 +263,11 @@ body {
overscroll-behavior-y: auto;
}
+::selection {
+ background-color: rgb(var(--brand-green-rgb) / 0.18);
+ color: inherit;
+}
+
/* Installed theme packages only target this documented token layer. Keeping
* the selectors here lets themes survive component refactors without gaining
* arbitrary DOM or JavaScript access. */
@@ -494,7 +499,7 @@ textarea {
line-height: var(--editor-body-line-height);
min-height: 100%;
outline: none;
- padding: 8px 12px 56px;
+ padding: 8px 0 56px;
}
.edgeever-public-share .ProseMirror {
@@ -551,32 +556,35 @@ textarea {
.ProseMirror {
max-width: none;
margin: 0;
- padding: 18px 16px max(4rem, env(safe-area-inset-bottom));
+ padding: 8px 0 max(4rem, env(safe-area-inset-bottom));
}
}
.ProseMirror h1 {
- font-size: 2rem;
- font-weight: 760;
- line-height: 1.25;
- margin: 0 0 1rem;
- color: #18181b;
+ font-size: 1.875rem;
+ font-weight: 700;
+ line-height: 1.28;
+ letter-spacing: -0.022em;
+ margin: 0 0 0.85rem;
+ color: #0f172a;
}
.ProseMirror h2 {
- font-size: 1.5rem;
- font-weight: 720;
- line-height: 1.3;
- margin: 1.4rem 0 0.7rem;
- color: #18181b;
+ font-size: 1.375rem;
+ font-weight: 650;
+ line-height: 1.32;
+ letter-spacing: -0.015em;
+ margin: 1.4rem 0 0.6rem;
+ color: #0f172a;
}
.ProseMirror h3 {
- font-size: 1.2rem;
- font-weight: 700;
- line-height: 1.35;
- margin: 1.2rem 0 0.6rem;
- color: #27272a;
+ font-size: 1.125rem;
+ font-weight: 600;
+ line-height: 1.38;
+ letter-spacing: -0.01em;
+ margin: 1.15rem 0 0.5rem;
+ color: #1e293b;
}
.ProseMirror p {
@@ -758,6 +766,7 @@ textarea {
width: 1rem;
height: 1rem;
margin: 0;
+ border-radius: 3px;
accent-color: var(--brand-green);
cursor: pointer;
}
@@ -771,6 +780,13 @@ textarea {
margin-bottom: 0;
}
+.ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div > p {
+ color: rgb(var(--slate-500-rgb));
+ text-decoration: line-through;
+ text-decoration-color: rgb(var(--slate-400-rgb));
+ transition: color 150ms ease, text-decoration 150ms ease;
+}
+
.ProseMirror ul[data-type="taskList"] ul[data-type="taskList"] {
margin: 0.25rem 0 0;
padding-left: 1.5rem;
@@ -779,28 +795,31 @@ textarea {
.ProseMirror blockquote {
margin: 0 0 1rem;
border-left: 3px solid var(--brand-green);
- padding: 0.1rem 0 0.1rem 1rem;
- color: #1e293b;
- background: var(--brand-green-soft);
+ border-radius: 1px 4px 4px 1px;
+ padding: 0.35rem 0.5rem 0.35rem 0.85rem;
+ color: #334155;
+ background: color-mix(in srgb, var(--brand-green) 4%, transparent);
}
.ProseMirror code {
- border: 1px solid #d9eadf;
- border-radius: 5px;
- background: #f6fbf7;
- padding: 0.08rem 0.28rem;
- font-size: 0.9em;
- color: #1e293b;
+ border: 1px solid rgb(var(--slate-300-rgb) / 0.6);
+ border-radius: 4px;
+ background: rgb(var(--slate-100-rgb) / 0.7);
+ padding: 0.12rem 0.35rem;
+ font-size: 0.875em;
+ color: #0f172a;
+ font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.ProseMirror pre {
margin: 0 0 1rem;
overflow-x: auto;
- border: 1px solid #d9eadf;
+ border: 1px solid rgb(var(--slate-300-rgb) / 0.6);
border-radius: 8px;
- background: #f7fbf8;
+ background: rgb(var(--slate-50-rgb) / 0.75);
padding: 0.9rem 1rem;
- color: #1e293b;
+ color: #0f172a;
+ box-shadow: 0 1px 2px rgb(var(--slate-900-rgb) / 0.03);
}
.ProseMirror pre code {
@@ -821,35 +840,41 @@ textarea {
top: 0.45rem;
right: 0.45rem;
z-index: 1;
- border: 1px solid #cbded1;
- border-radius: 5px;
- padding: 0.2rem 0.45rem;
- background: rgb(247 251 248 / 0.92);
+ border: 1px solid rgb(var(--slate-300-rgb) / 0.7);
+ border-radius: 6px;
+ padding: 0.22rem 0.5rem;
+ background: rgb(255 255 255 / 0.88);
+ backdrop-filter: blur(6px);
color: #475569;
font: inherit;
font-size: 0.72rem;
+ font-weight: 500;
line-height: 1.4;
cursor: pointer;
+ transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.ProseMirror .edgeever-code-copy-button:hover,
.ProseMirror .edgeever-code-copy-button:focus-visible {
- border-color: #0f766e;
- color: #0f766e;
+ border-color: var(--brand-green);
+ color: var(--brand-green-text);
+ background: rgb(255 255 255 / 0.96);
+ box-shadow: 0 1px 4px rgb(var(--brand-green-rgb) / 0.12);
outline: none;
}
.ProseMirror .edgeever-code-source {
overflow-x: auto;
- border: 1px solid #d9eadf;
+ border: 1px solid rgb(var(--slate-300-rgb) / 0.6);
border-radius: 8px;
- background: #f7fbf8;
+ background: rgb(var(--slate-50-rgb) / 0.75);
padding: 0.9rem 1rem;
- color: #1e293b;
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
+ color: #0f172a;
+ font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 0.875em;
white-space: pre;
padding-right: 5.5rem;
+ box-shadow: 0 1px 2px rgb(var(--slate-900-rgb) / 0.03);
}
.ProseMirror .edgeever-mermaid-code-block {
@@ -1266,32 +1291,77 @@ textarea {
.ProseMirror .tableWrapper,
.markdown-content .tableWrapper {
- width: fit-content;
+ --mobile-table-column-width: clamp(4.5rem, 24cqi, 12rem);
+ container-type: inline-size;
+ display: block;
+ width: 100%;
max-width: 100%;
+ min-width: 0;
overflow-x: auto;
+ overflow-y: hidden;
+ -webkit-overflow-scrolling: touch;
margin-top: 1.25rem;
margin-right: auto;
margin-bottom: 1.25rem;
margin-left: 0;
- border: 1px solid #d8d8d8;
- border-radius: 2px;
+ border: 1px solid rgb(var(--slate-300-rgb) / 0.7);
+ border-radius: 6px;
background: #fff;
overscroll-behavior-inline: contain;
scrollbar-color: rgb(100 116 139 / 0.28) transparent;
+ box-shadow: 0 1px 3px rgb(var(--slate-900-rgb) / 0.03);
}
.ProseMirror table,
.markdown-content table {
- width: max-content;
- min-width: 42rem !important;
+ width: 100%;
+ max-width: none;
+ min-width: 100%;
border-collapse: separate;
border-spacing: 0;
table-layout: fixed;
}
+/* Container query responsive column distributions for 1-4 columns */
+.ProseMirror table:has(> colgroup > col:first-child:last-child),
+.markdown-content table:has(> colgroup > col:first-child:last-child) {
+ --mobile-table-column-width: 100cqi;
+}
+
+.ProseMirror table:has(> colgroup > col:first-child:nth-last-child(2)),
+.markdown-content table:has(> colgroup > col:first-child:nth-last-child(2)) {
+ --mobile-table-column-width: 50cqi;
+}
+
+.ProseMirror table:has(> colgroup > col:first-child:nth-last-child(3)),
+.markdown-content table:has(> colgroup > col:first-child:nth-last-child(3)) {
+ --mobile-table-column-width: calc(100cqi / 3);
+}
+
+.ProseMirror table:has(> colgroup > col:first-child:nth-last-child(4)),
+.markdown-content table:has(> colgroup > col:first-child:nth-last-child(4)) {
+ --mobile-table-column-width: 25cqi;
+}
+
+/* For tables with 5+ columns on narrow viewports, expand width and scroll inside tableWrapper */
+.ProseMirror table:has(> colgroup > col:first-child:nth-last-child(n+5)),
+.markdown-content table:has(> colgroup > col:first-child:nth-last-child(n+5)) {
+ width: max-content;
+ --mobile-table-column-width: clamp(4.5rem, 24cqi, 12rem);
+}
+
+/* For tables without colgroup (plain markdown or pasted html), allow natural distribution */
+.ProseMirror table:not(:has(colgroup)),
+.markdown-content table:not(:has(colgroup)) {
+ table-layout: auto;
+ width: 100%;
+ min-width: 100%;
+}
+
.ProseMirror table col,
.markdown-content table col {
- width: 14rem !important;
+ width: var(--mobile-table-column-width) !important;
+ min-width: var(--mobile-table-column-width) !important;
}
.ProseMirror th,
@@ -1299,25 +1369,29 @@ textarea {
.markdown-content th,
.markdown-content td {
position: relative;
- width: 14rem;
- min-width: 14rem;
+ width: var(--mobile-table-column-width, auto);
+ min-width: var(--mobile-table-column-width, 3.5rem);
+ max-width: var(--mobile-table-column-width, none);
border: 0;
- border-right: 1px solid #dedede;
- border-bottom: 1px solid #dedede;
- padding: 0.42rem 0.75rem;
+ border-right: 1px solid rgb(var(--slate-200-rgb) / 0.8);
+ border-bottom: 1px solid rgb(var(--slate-200-rgb) / 0.8);
+ padding: 0.48rem 0.8rem;
text-align: left;
vertical-align: top;
+ white-space: normal;
overflow-wrap: anywhere;
- line-height: 1.4;
+ word-break: break-word;
+ line-height: 1.45;
transition: background-color 120ms ease;
}
.ProseMirror th,
.markdown-content th {
- background: #f0f0f0;
- color: #111827;
- font-size: 0.875rem;
- font-weight: 700;
+ background: rgb(var(--slate-100-rgb) / 0.75);
+ color: #0f172a;
+ font-size: 0.84rem;
+ font-weight: 600;
+ letter-spacing: -0.01em;
}
.ProseMirror th:last-child,
@@ -1334,59 +1408,34 @@ textarea {
.ProseMirror tbody tr:nth-child(even) td,
.markdown-content tbody tr:nth-child(even) td {
- background: #f8f8f8;
+ background: rgb(var(--slate-50-rgb) / 0.5);
}
.ProseMirror tbody tr:hover td,
.markdown-content tbody tr:hover td {
- background: #f3f4f6;
-}
-
-@media (max-width: 767px) {
- .ProseMirror .tableWrapper,
- .markdown-content .tableWrapper {
- --mobile-table-column-width: clamp(5.5rem, calc((100vw - 3rem) / 3), 14rem);
- width: 100%;
- }
-
- .ProseMirror table,
- .markdown-content table {
- min-width: 100% !important;
- }
-
- .ProseMirror table col,
- .markdown-content table col {
- width: var(--mobile-table-column-width) !important;
- }
-
- .ProseMirror th,
- .ProseMirror td,
- .markdown-content th,
- .markdown-content td {
- width: var(--mobile-table-column-width);
- min-width: var(--mobile-table-column-width);
- }
+ background: rgb(var(--slate-100-rgb) / 0.6);
}
@media (min-width: 768px) {
- .ProseMirror .tableWrapper {
- width: 100%;
- }
-
- .ProseMirror table {
+ .ProseMirror table:not(:has(> colgroup > col:first-child:nth-last-child(n+5))),
+ .markdown-content table:not(:has(> colgroup > col:first-child:nth-last-child(n+5))) {
width: 100%;
- min-width: 100% !important;
table-layout: auto;
}
- .ProseMirror table col {
+ .ProseMirror table:not(:has(> colgroup > col:first-child:nth-last-child(n+5))) col,
+ .markdown-content table:not(:has(> colgroup > col:first-child:nth-last-child(n+5))) col {
width: auto !important;
+ min-width: 0 !important;
}
- .ProseMirror th,
- .ProseMirror td {
+ .ProseMirror table:not(:has(> colgroup > col:first-child:nth-last-child(n+5))) th,
+ .ProseMirror table:not(:has(> colgroup > col:first-child:nth-last-child(n+5))) td,
+ .markdown-content table:not(:has(> colgroup > col:first-child:nth-last-child(n+5))) th,
+ .markdown-content table:not(:has(> colgroup > col:first-child:nth-last-child(n+5))) td {
width: auto;
min-width: 0;
+ max-width: none;
}
}
@@ -1407,31 +1456,32 @@ textarea {
:root.dark .ProseMirror th,
:root.dark .markdown-content th {
- background: #27303f;
- color: #f8fafc;
+ background: rgb(var(--slate-100-rgb) / 0.9);
+ color: #f1f5f9;
}
:root.dark .ProseMirror .tableWrapper,
:root.dark .markdown-content .tableWrapper {
- border-color: #334155;
- background: #0f172a;
+ border-color: rgb(var(--slate-200-rgb) / 0.9);
+ background: var(--workspace-editor);
+ box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
}
:root.dark .ProseMirror th,
:root.dark .ProseMirror td,
:root.dark .markdown-content th,
:root.dark .markdown-content td {
- border-color: #334155;
+ border-color: rgb(var(--slate-200-rgb) / 0.7);
}
:root.dark .ProseMirror tbody tr:nth-child(even) td,
:root.dark .markdown-content tbody tr:nth-child(even) td {
- background: #182235;
+ background: rgb(var(--slate-50-rgb) / 0.6);
}
:root.dark .ProseMirror tbody tr:hover td,
:root.dark .markdown-content tbody tr:hover td {
- background: #202b25;
+ background: rgb(var(--slate-100-rgb) / 0.8);
}
/* Theme-aware surfaces for legacy white utilities and fixed semantic colors. */
@@ -1646,14 +1696,27 @@ textarea {
:root.dark .ProseMirror blockquote {
color: #cbd5e1;
- background: var(--brand-green-soft);
+ background: color-mix(in srgb, var(--brand-green) 7%, transparent);
}
:root.dark .ProseMirror code,
:root.dark .ProseMirror pre {
- border-color: #166534;
- background: #13261a;
- color: #cbd5e1;
+ border-color: rgb(var(--slate-200-rgb) / 0.8);
+ background: rgb(var(--slate-100-rgb) / 0.8);
+ color: #e2e8f0;
+}
+
+:root.dark .ProseMirror .edgeever-code-copy-button {
+ border-color: rgb(var(--slate-200-rgb) / 0.9);
+ background: rgb(var(--slate-100-rgb) / 0.9);
+ color: #94a3b8;
+}
+
+:root.dark .ProseMirror .edgeever-code-copy-button:hover,
+:root.dark .ProseMirror .edgeever-code-copy-button:focus-visible {
+ border-color: var(--brand-green);
+ color: var(--brand-green-text);
+ background: rgb(var(--slate-200-rgb));
}
:root.dark .ProseMirror .edgeever-mermaid-code-block {
@@ -1682,9 +1745,9 @@ textarea {
}
:root.dark .ProseMirror .edgeever-code-source {
- border-color: #166534;
- background: #13261a;
- color: #cbd5e1;
+ border-color: rgb(var(--slate-200-rgb) / 0.8);
+ background: rgb(var(--slate-100-rgb) / 0.8);
+ color: #e2e8f0;
}
:root.dark .ProseMirror .edgeever-mermaid-preview {
diff --git a/apps/web/src/styles/mobile-markdown-editor.css b/apps/web/src/styles/mobile-markdown-editor.css
index 8c196523..cab05abc 100644
--- a/apps/web/src/styles/mobile-markdown-editor.css
+++ b/apps/web/src/styles/mobile-markdown-editor.css
@@ -569,6 +569,7 @@ html.dark .edgeever-mobile-tiptap-content a:hover {
width: 18px;
height: 18px;
margin: 0;
+ border-radius: 3px;
accent-color: #16a06e;
}
@@ -581,16 +582,24 @@ html.dark .edgeever-mobile-tiptap-content a:hover {
margin-bottom: 0;
}
+.edgeever-mobile-tiptap-content ul[data-type="taskList"] li[data-checked="true"] > div > p {
+ color: #94a3b8;
+ text-decoration: line-through;
+ transition: color 150ms ease, text-decoration 150ms ease;
+}
+
.edgeever-mobile-tiptap-content ul[data-type="taskList"] ul[data-type="taskList"] {
margin: 4px 0 0;
padding-left: 24px;
}
.edgeever-mobile-tiptap-content blockquote {
- border-left: 3px solid #cbd5e1;
- color: #475569;
+ border-left: 3px solid #16a06e;
+ border-radius: 1px 4px 4px 1px;
+ padding: 0.35rem 0.5rem 0.35rem 0.85rem;
+ color: #334155;
+ background: color-mix(in srgb, #16a06e 4%, transparent);
margin: 0 0 0.85em;
- padding-left: 0.9em;
}
.edgeever-mobile-tiptap-content hr {
@@ -610,14 +619,15 @@ html.dark .edgeever-mobile-tiptap-content a:hover {
.edgeever-mobile-tiptap-content .edgeever-code-source {
overflow-x: auto;
- border: 1px solid #d9eadf;
+ border: 1px solid #e2e8f0;
border-radius: 8px;
- background: #f7fbf8;
+ background: #f8fafc;
padding: 0.9rem 1rem;
- color: #1e293b;
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
+ color: #0f172a;
+ font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 0.875em;
white-space: pre;
+ box-shadow: 0 1px 2px rgb(15 23 42 / 0.03);
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-code-block {
@@ -736,55 +746,95 @@ html.dark .edgeever-mobile-tiptap-content a:hover {
}
.edgeever-mobile-tiptap-content .tableWrapper {
- --mobile-table-column-width: clamp(5.5rem, calc((100vw - 3rem) / 3), 14rem);
+ --mobile-table-column-width: clamp(4.5rem, 24cqi, 12rem);
+ container-type: inline-size;
+ display: block;
width: 100%;
max-width: 100%;
+ min-width: 0;
overflow-x: auto;
+ overflow-y: hidden;
+ -webkit-overflow-scrolling: touch;
margin-top: 1.25rem;
margin-right: auto;
margin-bottom: 1.25rem;
margin-left: 0;
- border: 1px solid #d8d8d8;
- border-radius: 2px;
+ border: 1px solid #e2e8f0;
+ border-radius: 6px;
background: #fff;
overscroll-behavior-inline: contain;
scrollbar-color: rgb(100 116 139 / 0.28) transparent;
+ box-shadow: 0 1px 3px rgb(15 23 42 / 0.03);
}
.edgeever-mobile-tiptap-content table {
- width: max-content;
- min-width: 100% !important;
+ width: 100%;
+ max-width: none;
+ min-width: 100%;
border-collapse: separate;
border-spacing: 0;
table-layout: fixed;
}
+/* Container query responsive column distributions for 1-4 columns */
+.edgeever-mobile-tiptap-content table:has(> colgroup > col:first-child:last-child) {
+ --mobile-table-column-width: 100cqi;
+}
+
+.edgeever-mobile-tiptap-content table:has(> colgroup > col:first-child:nth-last-child(2)) {
+ --mobile-table-column-width: 50cqi;
+}
+
+.edgeever-mobile-tiptap-content table:has(> colgroup > col:first-child:nth-last-child(3)) {
+ --mobile-table-column-width: calc(100cqi / 3);
+}
+
+.edgeever-mobile-tiptap-content table:has(> colgroup > col:first-child:nth-last-child(4)) {
+ --mobile-table-column-width: 25cqi;
+}
+
+/* For tables with 5+ columns on narrow viewports, expand width and scroll inside tableWrapper */
+.edgeever-mobile-tiptap-content table:has(> colgroup > col:first-child:nth-last-child(n+5)) {
+ width: max-content;
+ --mobile-table-column-width: clamp(4.5rem, 24cqi, 12rem);
+}
+
+/* For tables without colgroup (plain markdown or pasted html), allow natural distribution */
+.edgeever-mobile-tiptap-content table:not(:has(colgroup)) {
+ table-layout: auto;
+ width: 100%;
+ min-width: 100%;
+}
+
.edgeever-mobile-tiptap-content table col {
width: var(--mobile-table-column-width) !important;
+ min-width: var(--mobile-table-column-width) !important;
}
.edgeever-mobile-tiptap-content th,
.edgeever-mobile-tiptap-content td {
position: relative;
- width: var(--mobile-table-column-width);
- min-width: var(--mobile-table-column-width);
+ width: var(--mobile-table-column-width, auto);
+ min-width: var(--mobile-table-column-width, 3.5rem);
+ max-width: var(--mobile-table-column-width, none);
border: 0;
- border-right: 1px solid #dedede;
- border-bottom: 1px solid #dedede;
- padding: 0.42rem 0.75rem;
+ border-right: 1px solid #e2e8f0;
+ border-bottom: 1px solid #e2e8f0;
+ padding: 0.48rem 0.8rem;
text-align: left;
vertical-align: top;
white-space: normal;
overflow-wrap: anywhere;
- line-height: 1.4;
+ word-break: break-word;
+ line-height: 1.45;
transition: background-color 120ms ease;
}
.edgeever-mobile-tiptap-content th {
- background: #f0f0f0;
- color: #111827;
- font-size: 0.875rem;
- font-weight: 700;
+ background: #f8fafc;
+ color: #0f172a;
+ font-size: 0.84rem;
+ font-weight: 600;
}
.edgeever-mobile-tiptap-content th:last-child,
@@ -797,11 +847,11 @@ html.dark .edgeever-mobile-tiptap-content a:hover {
}
.edgeever-mobile-tiptap-content tbody tr:nth-child(even) td {
- background: #f8f8f8;
+ background: #fafafa;
}
.edgeever-mobile-tiptap-content tbody tr:hover td {
- background: #f3f4f6;
+ background: #f1f5f9;
}
.edgeever-mobile-tiptap-content th p,
@@ -817,20 +867,26 @@ html.dark .edgeever-mobile-tiptap-content a:hover {
background: rgb(16 185 129 / 0.14);
}
+:root.dark .edgeever-mobile-tiptap-content blockquote {
+ color: #cbd5e1;
+ background: color-mix(in srgb, #16a06e 7%, transparent);
+}
+
:root.dark .edgeever-mobile-tiptap-content th {
- background: #27303f;
+ background: #1e293b;
color: #f8fafc;
}
:root.dark .edgeever-mobile-tiptap-content .edgeever-code-source {
- border-color: #166534;
- background: #13261a;
- color: #cbd5e1;
+ border-color: #334155;
+ background: #1e293b;
+ color: #e2e8f0;
}
:root.dark .edgeever-mobile-tiptap-content .tableWrapper {
border-color: #334155;
background: #0f172a;
+ box-shadow: 0 1px 3px rgb(0 0 0 / 0.2);
}
:root.dark .edgeever-mobile-tiptap-content th,
@@ -843,7 +899,7 @@ html.dark .edgeever-mobile-tiptap-content a:hover {
}
:root.dark .edgeever-mobile-tiptap-content tbody tr:hover td {
- background: #202b3d;
+ background: #1e293b;
}
.edgeever-mobile-tiptap-content p.is-editor-empty:first-child::before {
diff --git a/apps/web/tailwind.config.ts b/apps/web/tailwind.config.ts
index 49d59d7d..80492037 100644
--- a/apps/web/tailwind.config.ts
+++ b/apps/web/tailwind.config.ts
@@ -15,14 +15,30 @@ export default {
extend: {
fontFamily: {
sans: [
- "Inter",
- "ui-sans-serif",
- "system-ui",
"-apple-system",
"BlinkMacSystemFont",
"Segoe UI",
+ "PingFang SC",
+ "Hiragino Sans GB",
+ "Microsoft YaHei",
+ "Noto Sans SC",
+ "Inter",
+ "ui-sans-serif",
+ "system-ui",
"sans-serif",
],
+ mono: [
+ "JetBrains Mono",
+ "Fira Code",
+ "ui-monospace",
+ "SFMono-Regular",
+ "Menlo",
+ "Monaco",
+ "Consolas",
+ "Liberation Mono",
+ "Courier New",
+ "monospace",
+ ],
},
boxShadow: {
panel: "0 1px 2px rgb(var(--slate-900-rgb) / 0.05), 0 16px 40px rgb(var(--slate-900-rgb) / 0.07)",