Files
edgeever/apps/web/src/styles/mobile-markdown-editor.css
T

950 lines
20 KiB
CSS

:root {
color-scheme: light;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
* {
box-sizing: border-box;
}
html,
body,
#mobile-editor-root {
min-height: 100%;
}
body {
margin: 0;
background: #fff;
color: #0f172a;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button,
input {
font: inherit;
}
.mobile-editor-shell {
min-height: 100dvh;
background: #fff;
}
.mobile-editor-header {
position: sticky;
top: 0;
z-index: 10;
display: flex;
min-height: 52px;
align-items: center;
justify-content: space-between;
gap: 8px;
border-bottom: 1px solid #f1f5f9;
background: #fff;
padding: max(8px, env(safe-area-inset-top)) 12px 8px;
}
.mobile-editor-back,
.mobile-editor-done,
.mobile-editor-tool-button {
border: 0;
border-radius: 999px;
background: transparent;
color: #0f172a;
font-weight: 700;
min-height: 36px;
padding: 7px 12px;
}
.mobile-editor-back {
min-width: 38px;
padding: 4px 8px;
font-size: 30px;
font-weight: 400;
line-height: 1;
}
.mobile-editor-actions {
display: flex;
min-width: 0;
flex: 1;
justify-content: flex-end;
gap: 8px;
}
.mobile-editor-done {
background: #020617;
color: #fff;
}
.mobile-editor-done:disabled,
.mobile-editor-tool-button:disabled {
background: #e2e8f0;
color: #64748b;
}
.mobile-editor-status {
align-self: center;
border-radius: 999px;
background: #f1f5f9;
color: #64748b;
font-size: 12px;
font-weight: 700;
padding: 6px 10px;
white-space: nowrap;
}
.mobile-editor-status.active {
background: #ecfdf5;
color: #047857;
}
.mobile-editor-status.error {
background: #fff1f2;
color: #be123c;
}
.mobile-editor-main {
display: grid;
gap: 10px;
padding: 14px 12px max(16px, env(safe-area-inset-bottom));
}
.mobile-editor-error {
border: 1px solid #fecdd3;
border-radius: 8px;
background: #fff1f2;
color: #9f1239;
font-size: 14px;
line-height: 1.5;
padding: 10px;
}
.mobile-editor-fatal {
display: flex;
min-height: 100dvh;
align-items: center;
justify-content: center;
background: #f8fafc;
padding: 24px;
}
.mobile-editor-fatal-card {
width: min(100%, 420px);
border: 1px solid #fecdd3;
border-radius: 14px;
background: #fff;
padding: 24px;
text-align: center;
box-shadow: 0 14px 36px rgb(15 23 42 / 8%);
}
.mobile-editor-fatal-card h1 {
margin: 0;
font-size: 18px;
}
.mobile-editor-fatal-card p {
margin: 10px 0 0;
color: #64748b;
font-size: 14px;
line-height: 1.6;
}
.mobile-editor-fatal-actions {
display: flex;
justify-content: center;
gap: 10px;
margin-top: 20px;
}
.mobile-editor-fatal-actions button {
min-height: 40px;
border: 1px solid #cbd5e1;
border-radius: 9px;
background: #fff;
color: #0f172a;
font-weight: 700;
padding: 8px 16px;
}
.mobile-editor-fatal-actions button.primary {
border-color: #16a06e;
background: #16a06e;
color: #fff;
}
:root.dark .mobile-editor-fatal {
background: #111827;
}
:root.dark .mobile-editor-fatal-card {
border-color: #7f1d1d;
background: #19222b;
color: #f8fafc;
}
:root.dark .mobile-editor-fatal-card p {
color: #94a3b8;
}
:root.dark .mobile-editor-fatal-actions button {
border-color: #475569;
background: #1e293b;
color: #f8fafc;
}
:root.dark .mobile-editor-fatal-actions button.primary {
border-color: #16a06e;
background: #16a06e;
}
.mobile-editor-title,
.mobile-editor-tags {
width: 100%;
border: 0;
background: #fff;
color: #0f172a;
outline: none;
}
.mobile-editor-title {
font-size: 28px;
font-weight: 800;
line-height: 1.2;
}
.mobile-editor-tags {
min-width: 0;
flex: 1;
color: #64748b;
font-size: 15px;
line-height: 1.5;
padding: 4px 0;
}
.mobile-editor-meta-row {
display: flex;
align-items: center;
gap: 10px;
min-width: 0;
}
.mobile-editor-notebook-button {
display: inline-flex;
align-items: center;
gap: 3px;
flex: 0 1 auto;
max-width: 46%;
min-width: 0;
height: 30px;
border: 0;
border-radius: 8px;
background: transparent;
color: #64748b;
font-size: 15px;
font-weight: 650;
line-height: 1;
padding: 0 5px 0 0;
}
.mobile-editor-notebook-button span {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mobile-editor-notebook-button:active {
color: #047857;
}
.mobile-editor-notebook-button:disabled {
color: #94a3b8;
}
.mobile-editor-title::placeholder,
.mobile-editor-tags::placeholder {
color: #94a3b8;
}
.mobile-editor-tool-row {
display: flex;
align-items: center;
gap: 4px;
min-height: 38px;
overflow-x: auto;
border-block: 1px solid #f1f5f9;
margin-inline: -12px;
padding: 6px 12px;
scrollbar-width: none;
}
.mobile-editor-tool-row::-webkit-scrollbar {
display: none;
}
.mobile-editor-tool-button {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
border: 1px solid transparent;
background: transparent;
color: #64748b;
min-height: 32px;
width: 36px;
padding: 0;
}
.mobile-editor-tool-button:active,
.mobile-editor-tool-button[aria-pressed="true"] {
background: #ecfdf5;
border-color: #bbf7d0;
color: #047857;
}
.mobile-editor-tool-button:disabled {
border-color: transparent;
}
.mobile-editor-tool-button:disabled:active {
background: #e2e8f0;
color: #334155;
}
.mobile-editor-sheet-backdrop {
position: fixed;
inset: 0;
z-index: 30;
display: flex;
align-items: flex-end;
background: rgb(15 23 42 / 0.22);
}
.mobile-editor-notebook-sheet {
width: 100%;
max-height: 68dvh;
overflow: hidden;
border-radius: 18px 18px 0 0;
background: #fff;
box-shadow: 0 -18px 45px rgb(15 23 42 / 0.16);
padding: 8px 0 max(10px, env(safe-area-inset-bottom));
}
:root.dark {
color-scheme: dark;
}
:root.dark body,
:root.dark .mobile-editor-shell {
background: #0f172a;
color: #f8fafc;
}
:root.dark .mobile-editor-header,
:root.dark .mobile-editor-title,
:root.dark .mobile-editor-tags,
:root.dark .mobile-editor-notebook-sheet {
background: #1e293b;
color: #f8fafc;
}
:root.dark .mobile-editor-header,
:root.dark .mobile-editor-tool-row {
border-color: #334155;
}
:root.dark .mobile-editor-back,
:root.dark .mobile-editor-tool-button {
color: #cbd5e1;
}
:root.dark .mobile-editor-status {
background: #334155;
color: #cbd5e1;
}
:root.dark .mobile-editor-status.active,
:root.dark .mobile-editor-tool-button:active,
:root.dark .mobile-editor-tool-button[aria-pressed="true"] {
background: #14532d;
border-color: #166534;
color: #86efac;
}
:root.dark .mobile-editor-status.error,
:root.dark .mobile-editor-error {
background: #4c0519;
border-color: #881337;
color: #fda4af;
}
:root.dark .mobile-editor-notebook-button,
:root.dark .mobile-editor-tags::placeholder,
:root.dark .mobile-editor-title::placeholder {
color: #94a3b8;
}
:root.dark .mobile-editor-sheet-backdrop {
background: rgb(2 6 23 / 0.62);
}
.mobile-editor-notebook-sheet-handle {
width: 38px;
height: 4px;
border-radius: 999px;
background: #cbd5e1;
margin: 2px auto 8px;
}
.mobile-editor-notebook-sheet-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
border-bottom: 1px solid #f1f5f9;
padding: 0 16px 10px;
}
.mobile-editor-notebook-sheet-header h2 {
margin: 0;
color: #0f172a;
font-size: 16px;
font-weight: 750;
}
.mobile-editor-notebook-sheet-header button {
border: 0;
border-radius: 999px;
background: #f8fafc;
color: #64748b;
font-size: 14px;
font-weight: 650;
padding: 6px 10px;
}
.mobile-editor-notebook-list {
max-height: calc(68dvh - 4.5rem - env(safe-area-inset-bottom));
overflow-y: auto;
padding: 8px;
}
.mobile-editor-notebook-option {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
width: 100%;
min-height: 44px;
border: 0;
border-radius: 10px;
background: transparent;
color: #334155;
font-size: 16px;
font-weight: 600;
text-align: left;
}
.mobile-editor-notebook-option span {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mobile-editor-notebook-option[aria-current="page"] {
background: #ecfdf5;
color: #047857;
}
.mobile-editor-notebook-option:active {
background: #f1f5f9;
}
.edgeever-mobile-tiptap-editor {
min-height: calc(100dvh - 14rem);
margin: 0 -12px;
}
.edgeever-mobile-tiptap-content {
min-height: calc(100dvh - 14rem);
outline: none;
padding: 18px 12px 32px;
color: #020617;
font-size: 17px;
line-height: 1.6;
-webkit-user-select: text;
user-select: text;
caret-color: auto;
white-space: pre-wrap;
}
/* External hyperlinks — match desktop default ProseMirror link styling. */
.edgeever-mobile-tiptap-content a {
color: #00751f;
font-weight: 500;
text-decoration: underline;
text-decoration-color: rgb(0 117 31 / 0.45);
text-underline-offset: 2px;
cursor: pointer;
}
.edgeever-mobile-tiptap-content a:active,
.edgeever-mobile-tiptap-content a:hover {
color: #16a06e;
text-decoration-color: #16a06e;
}
.edgeever-mobile-tiptap-content a.edgeever-attachment-link,
.edgeever-mobile-tiptap-content a[href*="/api/v1/resources/"] {
text-decoration: none;
}
:root.dark .edgeever-mobile-tiptap-content a,
html.dark .edgeever-mobile-tiptap-content a {
color: #86efac;
text-decoration-color: rgb(134 239 172 / 0.45);
}
:root.dark .edgeever-mobile-tiptap-content a:active,
:root.dark .edgeever-mobile-tiptap-content a:hover,
html.dark .edgeever-mobile-tiptap-content a:active,
html.dark .edgeever-mobile-tiptap-content a:hover {
color: #4ade80;
text-decoration-color: #4ade80;
}
.edgeever-mobile-tiptap-content p {
margin: 0 0 6px;
padding: 0;
line-height: 1.6;
}
.edgeever-mobile-tiptap-content h1,
.edgeever-mobile-tiptap-content h2,
.edgeever-mobile-tiptap-content h3 {
line-height: 1.25;
margin: 0.9em 0 0.45em;
}
.edgeever-mobile-tiptap-content ul,
.edgeever-mobile-tiptap-content ol {
margin: 0 0 0.85em;
padding-left: 1.4em;
}
.edgeever-mobile-tiptap-content ul {
list-style-type: disc;
}
.edgeever-mobile-tiptap-content ol {
list-style-type: decimal;
}
.edgeever-mobile-tiptap-content ul[data-type="taskList"] {
padding-left: 0;
list-style: none;
}
.edgeever-mobile-tiptap-content ul[data-type="taskList"] li[data-checked] {
display: flex;
align-items: flex-start;
gap: 9px;
margin: 4px 0;
}
.edgeever-mobile-tiptap-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-mobile-tiptap-content ul[data-type="taskList"] li[data-checked] > label input {
width: 18px;
height: 18px;
margin: 0;
border-radius: 3px;
accent-color: #16a06e;
}
.edgeever-mobile-tiptap-content ul[data-type="taskList"] li[data-checked] > div {
min-width: 0;
flex: 1 1 auto;
}
.edgeever-mobile-tiptap-content ul[data-type="taskList"] li[data-checked] > div > p {
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 #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;
}
.edgeever-mobile-tiptap-content hr {
border: 0;
border-top: 1px solid #e2e8f0;
margin: 1.2rem 0;
}
.edgeever-mobile-tiptap-content hr.edgeever-merge-divider,
.edgeever-mobile-tiptap-content hr[data-edgeever-merge-divider] {
border: 0;
border-top: 2px solid var(--memo-content-divider-color, #66ca80);
background: transparent;
height: 0;
margin: 1.5rem 0;
}
.edgeever-mobile-tiptap-content code {
border: 1px solid #d4ebdc;
border-radius: 4px;
background: #f2f9f5;
padding: 0.12rem 0.38rem;
font-size: 0.875em;
font-weight: 550;
color: #0d5f3a;
font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.edgeever-mobile-tiptap-content pre code {
border: 0;
background: transparent;
padding: 0;
color: inherit;
font-weight: normal;
}
.edgeever-mobile-tiptap-content .edgeever-code-source {
overflow-x: auto;
border: 1px solid #e2e8f0;
border-radius: 8px;
background: #f8fafc;
padding: 0.9rem 1rem;
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 {
position: relative;
margin: 18px 0;
overflow: visible;
background: transparent;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-toolbar {
position: absolute;
top: 0.5rem;
right: 0.5rem;
z-index: 2;
display: flex;
gap: 0.25rem;
padding: 0.25rem;
border: 1px solid #d9e2dc;
border-radius: 7px;
background: rgb(255 255 255 / 0.94);
box-shadow: 0 1px 3px rgb(15 23 42 / 0.08);
backdrop-filter: blur(6px);
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-tool-button {
display: inline-flex;
width: 2.75rem;
height: 2.75rem;
flex: 0 0 2.75rem;
align-items: center;
justify-content: center;
border: 0;
border-radius: 5px;
background: transparent;
color: #475569;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-tool-button svg {
width: 1.125rem;
height: 1.125rem;
stroke-width: 2;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-tool-button:active,
.edgeever-mobile-tiptap-content .edgeever-mermaid-tool-button:focus-visible,
.edgeever-mobile-tiptap-content .edgeever-mermaid-tool-button[aria-pressed="true"] {
background: #eaf5ee;
color: #0f766e;
outline: none;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-tool-button[data-state="copied"] {
color: #15803d;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-tool-button[data-state="error"] {
color: #be123c;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-preview {
display: flex;
max-height: min(70vh, 36rem);
min-height: 6rem;
align-items: center;
justify-content: center;
overflow: auto;
overscroll-behavior-x: contain;
overscroll-behavior-y: auto;
padding: 4rem 0.75rem 0.75rem;
border: 1px solid #d9e2dc;
border-radius: 8px;
background: #fbfdfb;
scrollbar-color: rgb(100 116 139 / 0.35) transparent;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-svg {
display: flex;
width: 100%;
min-width: 0;
align-self: flex-start;
justify-content: center;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-svg svg {
display: block;
width: auto;
max-width: 100%;
height: auto;
max-height: 440px;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-source {
display: none;
margin-top: 0.5rem;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-code-block.is-source-visible .edgeever-mermaid-source {
display: block;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-message,
.edgeever-mobile-tiptap-content .edgeever-mermaid-error {
margin: 0;
color: #64748b;
font-size: 0.82rem;
}
.edgeever-mobile-tiptap-content .edgeever-mermaid-error {
color: #be123c;
}
.edgeever-mobile-tiptap-content img {
height: auto;
max-width: 100%;
border-radius: 8px;
}
.edgeever-mobile-tiptap-content .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-top: 1.25rem;
margin-right: auto;
margin-bottom: 1.25rem;
margin-left: 0;
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: 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, auto);
min-width: var(--mobile-table-column-width, 3.5rem);
max-width: var(--mobile-table-column-width, none);
border: 0;
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;
word-break: break-word;
line-height: 1.45;
transition: background-color 120ms ease;
}
.edgeever-mobile-tiptap-content th {
background: #f8fafc;
color: #0f172a;
font-size: 0.84rem;
font-weight: 600;
}
.edgeever-mobile-tiptap-content th:last-child,
.edgeever-mobile-tiptap-content td:last-child {
border-right: 0;
}
.edgeever-mobile-tiptap-content tr:last-child td {
border-bottom: 0;
}
.edgeever-mobile-tiptap-content tbody tr:nth-child(even) td {
background: #fafafa;
}
.edgeever-mobile-tiptap-content tbody tr:hover td {
background: #f1f5f9;
}
.edgeever-mobile-tiptap-content th p,
.edgeever-mobile-tiptap-content td p {
margin: 0;
}
.edgeever-mobile-tiptap-content .selectedCell::after {
position: absolute;
inset: 0;
content: "";
pointer-events: none;
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: #1e293b;
color: #f8fafc;
}
:root.dark .edgeever-mobile-tiptap-content code {
border-color: rgba(22, 160, 110, 0.28);
background: rgba(22, 160, 110, 0.12);
color: #6ee7b7;
}
:root.dark .edgeever-mobile-tiptap-content .edgeever-code-source {
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,
:root.dark .edgeever-mobile-tiptap-content td {
border-color: #334155;
}
:root.dark .edgeever-mobile-tiptap-content tbody tr:nth-child(even) td {
background: #182235;
}
:root.dark .edgeever-mobile-tiptap-content tbody tr:hover td {
background: #1e293b;
}
.edgeever-mobile-tiptap-content p.is-editor-empty:first-child::before {
content: attr(data-placeholder);
float: left;
height: 0;
color: #94a3b8;
pointer-events: none;
}
.mobile-editor-fallback {
border: 1px solid #e2e8f0;
border-radius: 8px;
color: #475569;
font-size: 13px;
padding: 10px;
}
.mobile-editor-fallback pre {
overflow-x: auto;
white-space: pre-wrap;
}