Files
Docwell/Packages/editor/src/editor.css
T
tajniak81andClaude Opus 5.5 53dd43cc2e Add synced pages, editor settings and split view
Phase B items 7-9 of docs/AFFINE.md.

Synced pages: "![[" or /Synced page shows another page inside this one,
read-only and live. The copy follows the page over a read-only collab
connection (CollabProvider readOnly: no edits, no presence) in a nested
read-only editor; it folds to its title and opens the page. The node
keeps the page's title, so exports (Markdown, HTML, PDF, Word) and
readers without a host show it as a link to the page.

Settings: Account -> Editor sets, per device, the text size, full width
or a date title for new pages, showing properties and backlinks, and
code line numbers. The inbox settings choose which notification types
the email digest includes (users.notify_email_off, new migration).

Split view: Alt+click a page link, or Open beside in the page menu,
shows that page in a side pane on wide screens; it survives navigation
and reloads of the tab. The page menu opens pages in a new tab on the
web, and Ctrl+[ / Ctrl+] go back and forward.

Strings are translated into all five languages, the user guide covers
the new features, and the mobile editor bundle is rebuilt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 19:23:30 +01:00

1243 lines
27 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* SPDX-License-Identifier: AGPL-3.0-or-later */
@import "katex/dist/katex.min.css";
/* Tailwind classes used by the editor's own components (menus, find bar). */
@source "./";
/* Document styles for the Docwell editor, from the design system's Document
type scale. Uses tokens from @docwell/ui/theme.css. */
.dw-prose {
outline: none;
font-family: var(--font-sans);
font-size: var(--text-doc-body);
line-height: var(--text-doc-body--line-height);
color: var(--color-ink);
min-height: 12rem;
}
/* Paragraph blocks sit space-2 apart; a heading gets space-5 above it. */
.dw-prose > * + * {
margin-top: 8px;
}
.dw-prose > :is(h1, h2, h3, h4, h5, h6) {
margin-top: 20px;
}
.dw-prose h1 {
font-family: var(--font-serif);
font-size: var(--text-doc-h1);
line-height: var(--text-doc-h1--line-height);
font-weight: 600;
}
.dw-prose h2 {
font-family: var(--font-serif);
font-size: var(--text-doc-h2);
line-height: var(--text-doc-h2--line-height);
font-weight: 600;
}
.dw-prose h3 {
font-size: var(--text-doc-h3);
line-height: var(--text-doc-h3--line-height);
font-weight: 600;
}
.dw-prose ul {
list-style: disc;
padding-left: 1.5rem;
}
.dw-prose ol {
list-style: decimal;
padding-left: 1.5rem;
}
.dw-prose a {
color: var(--color-accent);
text-decoration: underline;
text-underline-offset: 2px;
}
.dw-prose blockquote {
border-left: 3px solid var(--color-line);
padding-left: 1rem;
color: var(--color-ink-muted);
}
.dw-prose code {
font-family: var(--font-mono);
font-size: 0.9em;
background: var(--color-code-bg);
padding: 0.1em 0.3em;
border-radius: var(--radius-xs);
}
.dw-prose pre {
font-family: var(--font-mono);
font-size: var(--text-code);
line-height: var(--text-code--line-height);
background: var(--color-code-bg);
padding: 12px 16px;
border-radius: var(--radius-md);
overflow-x: auto;
}
.dw-prose pre code {
background: none;
padding: 0;
font-size: inherit;
}
.dw-prose hr {
border: none;
border-top: 1px solid var(--color-line);
margin: 24px 0;
}
.dw-prose ::selection {
background: var(--color-selection);
}
.dw-prose p.is-editor-empty:first-child::before {
content: attr(data-placeholder);
color: var(--color-ink-faint);
float: left;
height: 0;
pointer-events: none;
}
.dw-prose img {
display: block;
max-width: 100%;
height: auto;
border-radius: var(--radius-md);
}
.dw-prose img.ProseMirror-selectednode,
.dw-prose .dw-file-block.ProseMirror-selectednode .dw-file,
.dw-prose .ProseMirror-selectednode:is(.dw-mermaid, .dw-diagram, .dw-toc, .tiptap-mathematics-render) {
outline: 2px solid var(--color-focus-ring);
outline-offset: 2px;
}
/* A non-image attachment: a one-line download card. */
.dw-prose .dw-file {
display: flex;
align-items: center;
gap: 12px;
padding: 8px 12px;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
background: var(--color-surface-raised);
font-family: var(--font-sans);
font-size: var(--text-ui-md);
}
.dw-prose .dw-file__name {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dw-prose .dw-file__size {
color: var(--color-ink-muted);
font-size: var(--text-ui-sm);
}
/* Other editors' carets (CollaborationCaret's default render). */
.dw-prose .collaboration-carets__caret {
position: relative;
margin-left: -1px;
margin-right: -1px;
border-left: 1px solid;
border-right: 1px solid;
word-break: normal;
pointer-events: none;
}
.dw-prose .collaboration-carets__label {
position: absolute;
top: -1.4em;
left: -1px;
padding: 0.1rem 0.3rem;
border-radius: var(--radius-xs) var(--radius-xs) var(--radius-xs) 0;
font-family: var(--font-sans);
font-size: 12px;
font-weight: 600;
line-height: normal;
color: #fff;
white-space: nowrap;
user-select: none;
}
/* "@" mentions. */
.dw-prose .dw-mention {
border-radius: var(--radius-xs);
background: var(--color-accent-soft);
padding: 0 0.15em;
font-weight: 500;
white-space: nowrap;
}
/* Dates in the text; a reminder shows a bell, and one whose day has passed is muted. */
.dw-prose .dw-date {
display: inline-flex;
align-items: center;
gap: 0.2em;
border-radius: var(--radius-xs);
background: var(--color-surface-hover);
padding: 0 0.25em;
font-weight: 500;
white-space: nowrap;
cursor: default;
}
.dw-prose .dw-date svg {
flex-shrink: 0;
color: var(--color-ink-muted);
}
.dw-prose .dw-date.is-reminder {
background: var(--color-accent-soft);
}
.dw-prose .dw-date.is-past {
color: var(--color-ink-muted);
text-decoration: line-through;
}
.dw-prose[contenteditable="true"] .dw-date,
.dw-prose .dw-date.is-link {
cursor: pointer;
}
.dw-prose[contenteditable="false"] .dw-date.is-link:hover {
text-decoration: underline;
}
.dw-date-pop__open {
align-self: flex-start;
border: 0;
background: none;
padding: 0;
font: inherit;
color: var(--color-accent);
cursor: pointer;
}
.dw-date-pop__open:hover {
text-decoration: underline;
}
.dw-date-pop {
position: fixed;
z-index: 60;
left: 0;
top: 0;
display: flex;
flex-direction: column;
gap: 8px;
width: 16rem;
max-width: calc(100vw - 16px);
padding: 10px;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
background: var(--color-surface-raised);
box-shadow: var(--shadow-menu);
font-family: var(--font-sans);
font-size: var(--text-ui-sm);
color: var(--color-ink);
}
.dw-date-pop__check {
display: flex;
align-items: center;
gap: 8px;
font-weight: 500;
cursor: pointer;
}
.dw-date-pop__note {
margin: 0;
color: var(--color-ink-muted);
font-size: var(--text-ui-xs);
}
/* Commented text; the active comment's text stands out more. */
.dw-prose .dw-comment {
background: color-mix(in srgb, var(--color-warning-soft) 70%, transparent);
border-bottom: 2px solid color-mix(in srgb, var(--color-warning) 55%, transparent);
cursor: pointer;
}
.dw-prose .dw-comment.is-active {
background: var(--color-warning-soft);
border-bottom-color: var(--color-warning);
}
/* The "/" and "@" popups (suggestion.ts): the design system's slash menu,
drawn without a framework so every host can show it. */
.dw-suggest {
position: fixed;
z-index: 60;
left: 0;
top: 0;
width: 20rem;
max-width: calc(100vw - 16px);
max-height: 22rem;
overflow-y: auto;
padding: 4px;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
background: var(--color-surface-raised);
box-shadow: var(--dw-shadow-menu);
font-family: var(--font-sans);
}
.dw-suggest__query {
padding: 8px 8px 4px;
font-family: var(--font-mono);
font-size: var(--text-ui-xs);
color: var(--color-ink-muted);
}
.dw-suggest__empty {
padding: 6px 8px;
font-size: var(--text-ui-sm);
color: var(--color-ink-muted);
}
.dw-suggest__item {
display: flex;
align-items: center;
gap: 12px;
padding: 6px 8px;
border-radius: var(--radius-sm);
cursor: pointer;
}
.dw-suggest__item.is-active {
background: var(--color-surface-hover);
}
.dw-suggest__icon {
display: grid;
place-items: center;
flex-shrink: 0;
width: 36px;
height: 36px;
border: 1px solid var(--color-line);
border-radius: var(--radius-sm);
background: var(--color-surface);
color: var(--color-ink-muted);
}
.dw-suggest__text {
display: flex;
flex-direction: column;
min-width: 0;
}
.dw-suggest__label {
font-size: var(--text-ui-md);
font-weight: 500;
color: var(--color-ink);
}
.dw-suggest__desc {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: var(--text-ui-xs);
color: var(--color-ink-muted);
}
/* ---- Math (KaTeX) ---- */
.dw-prose .tiptap-mathematics-render {
cursor: default;
}
.dw-prose.ProseMirror[contenteditable="true"] .tiptap-mathematics-render {
cursor: pointer;
border-radius: var(--radius-xs);
}
.dw-prose.ProseMirror[contenteditable="true"] .tiptap-mathematics-render:hover {
background: var(--color-surface-hover);
}
.dw-prose [data-type="block-math"] {
display: block;
text-align: center;
padding: 8px 0;
overflow-x: auto;
}
/* ---- Mermaid ---- */
.dw-prose .dw-mermaid {
padding: 12px;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
background: var(--color-surface-raised);
overflow-x: auto;
text-align: center;
}
.dw-prose.ProseMirror[contenteditable="true"] .dw-mermaid {
cursor: pointer;
}
.dw-prose .dw-mermaid svg {
max-width: 100%;
height: auto;
margin: 0 auto;
}
.dw-prose .dw-mermaid__source {
margin: 0;
font-family: var(--font-mono);
font-size: var(--text-ui-sm);
text-align: left;
white-space: pre-wrap;
}
.dw-prose .dw-mermaid__body--error {
font-family: var(--font-mono);
font-size: var(--text-ui-sm);
color: var(--color-danger);
text-align: left;
white-space: pre-wrap;
}
/* ---- Draw.io and Excalidraw drawings ---- */
.dw-prose .dw-diagram {
position: relative;
margin: 0;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
background: #fff;
overflow: hidden;
}
.dw-prose .dw-diagram__img {
display: block;
max-width: 100%;
margin: 0 auto;
border-radius: 0;
}
.dw-prose .dw-diagram__empty {
margin: 0;
padding: 32px 16px;
text-align: center;
font-family: var(--font-sans);
font-size: var(--text-ui-md);
color: var(--color-ink-muted);
background: var(--color-surface-raised);
cursor: pointer;
}
.dw-prose .dw-diagram__edit {
position: absolute;
top: 8px;
right: 8px;
padding: 2px 10px;
border: 1px solid var(--color-line);
border-radius: var(--radius-sm);
background: var(--color-surface-raised);
color: var(--color-ink);
font: inherit;
font-size: var(--text-ui-sm);
cursor: pointer;
opacity: 0;
transition: opacity 0.15s;
}
.dw-prose .dw-diagram:hover .dw-diagram__edit,
.dw-prose .dw-diagram__edit:focus-visible {
opacity: 1;
}
@media (hover: none) {
.dw-prose .dw-diagram__edit {
opacity: 1;
}
}
/* The full-screen layer for the Draw.io or Excalidraw editor. */
.dw-diagram-editor {
position: fixed;
inset: 0;
z-index: 100;
display: flex;
flex-direction: column;
background: var(--color-surface);
}
.dw-diagram-editor__frame {
flex: 1;
width: 100%;
border: 0;
}
.dw-diagram-editor__bar {
display: flex;
justify-content: flex-end;
gap: 8px;
padding: 8px 12px;
border-bottom: 1px solid var(--color-line);
}
.dw-diagram-editor__canvas {
flex: 1;
min-height: 0;
}
.dw-diagram-editor__status {
padding: 8px 12px;
font-size: var(--text-ui-sm);
color: var(--color-ink-muted);
}
/* ---- Table of contents ---- */
.dw-prose .dw-toc {
padding: 12px 16px;
border-left: 3px solid var(--color-line);
font-family: var(--font-sans);
font-size: var(--text-ui-md);
}
.dw-prose .dw-toc__title {
margin: 0 0 4px;
font-size: var(--text-ui-xs);
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--color-ink-muted);
}
.dw-prose .dw-toc__list {
list-style: none;
padding: 0;
margin: 0;
}
.dw-prose .dw-toc__list a {
color: var(--color-ink-muted);
text-decoration: none;
}
.dw-prose .dw-toc__list a:hover {
color: var(--color-ink);
text-decoration: underline;
}
.dw-prose .dw-toc__empty {
color: var(--color-ink-faint);
}
/* ---- Toggles ---- */
.dw-prose .dw-toggle {
display: flex;
gap: 4px;
align-items: flex-start;
}
.dw-prose .dw-toggle > button {
flex: none;
display: grid;
place-items: center;
width: 24px;
height: calc(var(--text-doc-body--line-height) * 1em);
border: none;
border-radius: var(--radius-xs);
background: none;
color: var(--color-ink-muted);
cursor: pointer;
}
.dw-prose .dw-toggle > button:hover {
background: var(--color-surface-hover);
color: var(--color-ink);
}
.dw-prose .dw-toggle > button::before {
content: "";
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 7px solid currentColor;
transition: transform 0.12s ease;
}
.dw-prose .dw-toggle.is-open > button::before {
transform: rotate(90deg);
}
.dw-prose .dw-toggle > div {
flex: 1;
min-width: 0;
}
.dw-prose .dw-toggle summary {
display: block;
list-style: none;
font-weight: 600;
}
.dw-prose .dw-toggle summary::-webkit-details-marker {
display: none;
}
.dw-prose .dw-toggle [data-type="detailsContent"] > * + * {
margin-top: 8px;
}
.dw-prose .dw-toggle [data-type="detailsContent"] {
margin-top: 4px;
}
.dw-prose .dw-toggle [data-type="detailsContent"][hidden] {
display: none;
}
/* ---- Embeds and link cards ---- */
.dw-prose .dw-embed {
margin: 0;
}
.dw-prose .dw-embed__frame {
display: block;
width: 100%;
aspect-ratio: 16 / 9;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
background: var(--color-surface-sunken);
}
.dw-prose .dw-embed[data-ratio="audio"] .dw-embed__frame {
aspect-ratio: auto;
height: 152px;
}
.dw-prose .dw-embed[data-ratio="tall"] .dw-embed__frame {
aspect-ratio: 4 / 5;
max-height: 80vh;
}
.dw-prose .dw-embed__caption {
margin-top: 4px;
font-family: var(--font-sans);
font-size: var(--text-ui-sm);
color: var(--color-ink-muted);
}
.dw-prose .dw-embed__caption a {
color: inherit;
}
.dw-prose .dw-linkcard {
display: flex;
align-items: stretch;
gap: 12px;
overflow: hidden;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
color: var(--color-ink);
text-decoration: none;
font-family: var(--font-sans);
}
.dw-prose .dw-linkcard:hover {
background: var(--color-surface-hover);
}
.dw-prose .dw-linkcard__text {
display: flex;
flex: 1;
min-width: 0;
flex-direction: column;
gap: 2px;
padding: 10px 14px;
}
.dw-prose .dw-linkcard__title {
font-size: var(--text-ui-md);
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dw-prose .dw-linkcard__desc {
font-size: var(--text-ui-sm);
color: var(--color-ink-muted);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.dw-prose .dw-linkcard__site {
font-size: var(--text-ui-xs);
color: var(--color-ink-faint);
}
.dw-prose .dw-linkcard__image {
flex: none;
width: 30%;
max-width: 200px;
max-height: 120px;
object-fit: cover;
}
.dw-prose .ProseMirror-selectednode:is(.dw-embed, .dw-linkcard) {
outline: 2px solid var(--color-focus-ring);
outline-offset: 2px;
border-radius: var(--radius-md);
}
/* ---- Block links ---- */
.dw-block-host {
position: relative;
}
.dw-block-gutter {
position: absolute;
right: calc(100% + 6px);
display: flex;
gap: 2px;
}
.dw-block-gutter[hidden],
.dw-block-handle[hidden] {
display: none;
}
.dw-block-handle {
display: grid;
place-items: center;
width: 22px;
height: 22px;
border: none;
border-radius: var(--radius-xs);
background: none;
color: var(--color-ink-faint);
cursor: pointer;
}
.dw-block-handle:hover {
background: var(--color-surface-hover);
color: var(--color-ink);
}
/* Phones have no margin to spare and no hover. */
@media (max-width: 640px), (hover: none) {
.dw-block-gutter {
display: none;
}
}
/* ---- The floating source editor (math, Mermaid) ---- */
.dw-source {
position: absolute;
z-index: 60;
width: min(32rem, calc(100vw - 16px));
padding: 8px;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
background: var(--color-surface-raised);
box-shadow: var(--dw-shadow-menu);
}
.dw-source__field {
display: block;
width: 100%;
padding: 6px 8px;
border: 1px solid var(--color-line-strong);
border-radius: var(--radius-sm);
background: var(--color-surface);
color: var(--color-ink);
font: inherit;
font-size: var(--text-ui-md);
resize: vertical;
}
.dw-source__field--mono {
font-family: var(--font-mono);
font-size: var(--text-ui-sm);
}
.dw-source__field:focus {
outline: 2px solid var(--color-focus-ring);
outline-offset: 1px;
}
.dw-source__actions {
display: flex;
gap: 6px;
margin-top: 8px;
}
.dw-source__btn {
padding: 3px 10px;
border: 1px solid var(--color-line);
border-radius: var(--radius-sm);
background: var(--color-surface);
color: var(--color-ink);
font: inherit;
font-size: var(--text-ui-sm);
cursor: pointer;
}
.dw-source__btn:hover {
background: var(--color-surface-hover);
}
.dw-source__btn--primary {
border-color: var(--color-primary);
background: var(--color-primary);
color: var(--color-on-primary);
}
.dw-source__btn--primary:hover {
background: var(--color-primary-hover);
}
.dw-source__btn--danger {
color: var(--color-danger);
}
/* Find in page: every match, and the one the bar is on. */
.dw-prose .dw-find {
background: color-mix(in srgb, var(--color-accent) 22%, transparent);
border-radius: 2px;
}
.dw-prose .dw-find-current {
background: color-mix(in srgb, var(--color-accent) 50%, transparent);
outline: 1px solid var(--color-accent);
}
/* The page's body font, chosen per page; headings follow it too. */
.dw-font-serif .dw-prose,
.dw-font-serif .dw-prose :is(h1, h2, h3, h4, h5, h6) {
font-family: var(--font-serif);
}
.dw-font-mono .dw-prose,
.dw-font-mono .dw-prose :is(h1, h2, h3, h4, h5, h6) {
font-family: var(--font-mono);
}
/* ---- Headings 4–6 ("Other headings") ---- */
.dw-prose h4 {
font-size: var(--text-doc-body);
line-height: var(--text-doc-body--line-height);
font-weight: 600;
}
.dw-prose h5 {
font-size: var(--text-ui-md);
font-weight: 600;
}
.dw-prose h6 {
font-size: var(--text-ui-sm);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--color-ink-muted);
}
/* ---- Palette colours (colors.ts): text, highlight and callout shades ---- */
:root {
--dw-c-gray: #6b6f6d;
--dw-c-red: #c0392b;
--dw-c-orange: #c2571a;
--dw-c-yellow: #9a7400;
--dw-c-green: #3d7a1f;
--dw-c-teal: #1f7f79;
--dw-c-blue: #2f6fbf;
--dw-c-purple: #7c5cc4;
--dw-c-pink: #b8327a;
--dw-bg-gray: #ecece9;
--dw-bg-red: #fbe3df;
--dw-bg-orange: #fbe7d7;
--dw-bg-yellow: #fbf1c7;
--dw-bg-green: #e4f1d8;
--dw-bg-teal: #d9efec;
--dw-bg-blue: #dfe9f7;
--dw-bg-purple: #ebe4f7;
--dw-bg-pink: #f8e0ec;
}
.dark {
--dw-c-gray: #a3a8a5;
--dw-c-red: #f08a7e;
--dw-c-orange: #f0a26a;
--dw-c-yellow: #e5c454;
--dw-c-green: #93c96b;
--dw-c-teal: #6cc9bf;
--dw-c-blue: #86b2ec;
--dw-c-purple: #b9a2ec;
--dw-c-pink: #eb8fc0;
--dw-bg-gray: #34383a;
--dw-bg-red: #4a2723;
--dw-bg-orange: #4a3020;
--dw-bg-yellow: #45391a;
--dw-bg-green: #2c3f22;
--dw-bg-teal: #1e3d3a;
--dw-bg-blue: #22334d;
--dw-bg-purple: #352b4d;
--dw-bg-pink: #47263a;
}
[data-color="gray"] {
--dw-c: var(--dw-c-gray);
--dw-bg: var(--dw-bg-gray);
}
[data-color="red"] {
--dw-c: var(--dw-c-red);
--dw-bg: var(--dw-bg-red);
}
[data-color="orange"] {
--dw-c: var(--dw-c-orange);
--dw-bg: var(--dw-bg-orange);
}
[data-color="yellow"] {
--dw-c: var(--dw-c-yellow);
--dw-bg: var(--dw-bg-yellow);
}
[data-color="green"] {
--dw-c: var(--dw-c-green);
--dw-bg: var(--dw-bg-green);
}
[data-color="teal"] {
--dw-c: var(--dw-c-teal);
--dw-bg: var(--dw-bg-teal);
}
[data-color="blue"] {
--dw-c: var(--dw-c-blue);
--dw-bg: var(--dw-bg-blue);
}
[data-color="purple"] {
--dw-c: var(--dw-c-purple);
--dw-bg: var(--dw-bg-purple);
}
[data-color="pink"] {
--dw-c: var(--dw-c-pink);
--dw-bg: var(--dw-bg-pink);
}
.dw-prose .dw-text-color {
color: var(--dw-c);
}
.dw-prose mark.dw-highlight {
background: var(--dw-bg, var(--dw-bg-yellow));
color: inherit;
border-radius: 2px;
padding: 0 1px;
}
/* The swatches in the selection toolbar's colour panel. */
.dw-swatch {
display: grid;
place-items: center;
width: 22px;
height: 22px;
border: 1px solid var(--color-line);
border-radius: var(--radius-xs);
background: var(--color-surface);
font-family: var(--font-sans);
font-size: 12px;
font-weight: 700;
color: var(--dw-c, var(--color-ink));
cursor: pointer;
}
.dw-swatch--fill {
background: var(--dw-bg);
}
.dw-swatch--none {
background: linear-gradient(135deg, transparent 45%, var(--color-danger) 45% 55%, transparent 55%);
}
.dw-swatch[aria-pressed="true"],
.dw-swatch:hover {
outline: 2px solid var(--color-focus-ring);
outline-offset: 1px;
}
/* ---- Callouts ---- */
.dw-prose .dw-callout {
display: flex;
gap: 10px;
padding: 12px 16px 12px 12px;
border-radius: var(--radius-md);
background: var(--dw-bg, var(--dw-bg-blue));
}
.dw-callout__side {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
user-select: none;
}
.dw-callout__emoji {
display: grid;
place-items: center;
width: 28px;
height: 28px;
border: none;
border-radius: var(--radius-sm);
background: none;
font-size: 20px;
line-height: 1;
cursor: pointer;
}
.dw-callout__emoji:hover {
background: color-mix(in srgb, var(--dw-c) 14%, transparent);
}
.dw-callout__color {
width: 12px;
height: 12px;
border: 2px solid var(--color-surface);
border-radius: 50%;
background: var(--dw-c);
cursor: pointer;
opacity: 0;
}
.dw-callout:hover .dw-callout__color,
.dw-callout__color:focus-visible {
opacity: 1;
}
.dw-prose[contenteditable="false"] .dw-callout__color {
display: none;
}
.dw-prose[contenteditable="false"] .dw-callout__emoji {
cursor: default;
}
.dw-callout__body {
flex: 1;
min-width: 0;
padding-top: 2px;
}
.dw-callout__body > * + * {
margin-top: 8px;
}
/* ---- To-do lists ---- */
.dw-prose ul[data-type="taskList"] {
list-style: none;
padding-left: 2px;
}
.dw-prose ul[data-type="taskList"] li {
display: flex;
align-items: flex-start;
gap: 8px;
}
.dw-prose ul[data-type="taskList"] li > label {
flex-shrink: 0;
margin-top: 0.3em;
user-select: none;
}
.dw-prose ul[data-type="taskList"] li > label input {
width: 16px;
height: 16px;
accent-color: var(--color-primary);
cursor: pointer;
}
.dw-prose ul[data-type="taskList"] li > div {
flex: 1;
min-width: 0;
}
.dw-prose ul[data-type="taskList"] li[data-checked="true"] > div > p {
color: var(--color-ink-muted);
text-decoration: line-through;
}
.dw-prose ul[data-type="taskList"] ul[data-type="taskList"] {
margin-top: 4px;
}
/* ---- Tables ---- */
.dw-prose .tableWrapper {
overflow-x: auto;
margin: 12px 0;
}
.dw-prose table {
border-collapse: collapse;
table-layout: fixed;
width: 100%;
overflow: hidden;
}
.dw-prose :is(td, th) {
position: relative;
min-width: 60px;
padding: 6px 10px;
border: 1px solid var(--color-line-strong);
vertical-align: top;
box-sizing: border-box;
}
.dw-prose :is(td, th) > * + * {
margin-top: 6px;
}
.dw-prose th {
background: var(--color-surface-sunken);
font-weight: 600;
text-align: left;
}
.dw-prose .selectedCell::after {
content: "";
position: absolute;
inset: 0;
background: var(--color-selection);
pointer-events: none;
}
.dw-prose .column-resize-handle {
position: absolute;
top: 0;
right: -2px;
bottom: -2px;
width: 4px;
background: var(--color-focus-ring);
pointer-events: none;
}
.dw-prose.resize-cursor {
cursor: col-resize;
}
/* ---- Code line numbers ---- */
.dw-prose pre.dw-code {
display: flex;
gap: 12px;
}
.dw-prose pre.dw-code > code {
flex: 1;
min-width: 0;
}
.dw-prose pre .dw-code__gutter {
display: none;
flex-shrink: 0;
min-width: 1.5em;
padding-right: 10px;
border-right: 1px solid var(--color-line);
color: var(--color-ink-faint);
text-align: right;
/* ProseMirror resets white-space on parts that are not editable. */
white-space: pre;
user-select: none;
}
.dw-prose pre.dw-code--numbered .dw-code__gutter {
display: block;
}
/* ---- PDFs shown inline ---- */
.dw-prose .dw-file-block > * + * {
margin-top: 6px;
}
.dw-pdf {
display: flex;
flex-direction: column;
gap: 8px;
max-height: 560px;
padding: 8px;
overflow-y: auto;
border: 1px solid var(--color-line);
border-radius: var(--radius-md);
background: var(--color-surface-sunken);
}
.dw-pdf:focus-visible {
outline: 2px solid var(--color-focus-ring);
}
.dw-pdf__page {
width: 100%;
background: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.dw-pdf__page canvas {
display: block;
width: 100%;
height: auto;
}
.dw-pdf__status {
padding: 24px;
text-align: center;
font-family: var(--font-sans);
font-size: var(--text-ui-sm);
color: var(--color-ink-muted);
}
/* ---- The block grip and its menu ---- */
.dw-block-grip {
cursor: grab;
}
.dw-block-grip[aria-expanded="true"] {
background: var(--color-surface-hover);
color: var(--color-ink);
}
.dw-block-menu {
width: 15rem;
}
.dw-block-menu .dw-suggest__item {
width: 100%;
border: none;
background: none;
font: inherit;
text-align: left;
cursor: pointer;
}
.dw-block-menu .dw-suggest__item.is-active {
background: var(--color-surface-hover);
}
.dw-block-menu .dw-suggest__item:focus {
outline: none;
}
.dw-block-menu .dw-suggest__item.is-danger :is(.dw-suggest__label, .dw-suggest__icon) {
color: var(--color-danger);
}
.dw-suggest__more,
.dw-block-menu__more {
margin-left: auto;
color: var(--color-ink-faint);
}
/* ---- Moving table rows and columns (tablemove.ts) ---- */
.dw-table-grip {
position: absolute;
z-index: 5;
display: grid;
place-items: center;
width: 14px;
height: 22px;
padding: 0;
border: 1px solid var(--color-line-strong);
border-radius: var(--radius-xs);
background: var(--color-surface-raised);
color: var(--color-ink-faint);
cursor: grab;
touch-action: none;
}
.dw-table-grip--column {
width: 22px;
height: 14px;
}
.dw-table-grip::before {
content: "";
width: 4px;
height: 10px;
background: radial-gradient(circle, currentColor 1px, transparent 1.5px) 0 0 / 4px 4px;
}
.dw-table-grip--column::before {
width: 10px;
height: 4px;
}
.dw-table-grip:hover,
.dw-table-grip:active {
color: var(--color-ink);
border-color: var(--color-focus-ring);
}
.dw-table-grip:active {
cursor: grabbing;
}
.dw-table-grip[hidden],
.dw-table-drop[hidden] {
display: none;
}
.dw-table-drop {
position: absolute;
z-index: 5;
background: var(--color-focus-ring);
pointer-events: none;
}
.dw-prose .dw-table-dragging {
opacity: 0.45;
}
@media (max-width: 640px), (hover: none) {
.dw-table-grip {
display: none;
}
}
/* ---- Synced pages (syncedpage.ts) ---- */
.dw-prose .dw-synced {
margin: 0.75em 0;
border: 1px solid var(--color-line);
border-left: 3px solid var(--color-accent);
border-radius: var(--radius-sm);
background: var(--color-surface);
}
.dw-prose .dw-synced__head {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 10px;
border-bottom: 1px solid var(--color-line);
font-family: var(--font-sans);
font-size: 13px;
color: var(--color-ink-muted);
}
.dw-prose .dw-synced.is-folded .dw-synced__head {
border-bottom: 0;
}
.dw-prose .dw-synced__badge {
flex: none;
color: var(--color-accent);
}
.dw-prose .dw-synced__title {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-weight: 600;
color: var(--color-ink);
text-decoration: none;
}
.dw-prose .dw-synced__title:hover {
text-decoration: underline;
}
.dw-prose .dw-synced__btn {
flex: none;
border: 0;
border-radius: var(--radius-xs);
background: none;
padding: 2px 6px;
font: inherit;
color: inherit;
cursor: pointer;
}
.dw-prose .dw-synced__btn:hover {
background: var(--color-surface-hover);
color: var(--color-ink);
}
.dw-prose .dw-synced__body {
padding: 4px 14px;
}
.dw-prose .dw-synced__body:empty {
display: none;
}
.dw-prose .dw-synced__body .dw-prose > :first-child {
margin-top: 0.5em;
}
.dw-prose .dw-synced__note {
margin: 0.5em 0;
font-family: var(--font-sans);
font-size: 13px;
color: var(--color-ink-muted);
}
/* The reader's text size (account settings, kept per device). */
.dw-size-sm {
--text-doc-body: 14px;
--text-doc-body--line-height: 24px;
}
.dw-size-lg {
--text-doc-body: 18px;
--text-doc-body--line-height: 30px;
}
.dw-prose .dw-synced__body .dw-prose {
min-height: 0;
}