forge
Explore
Log in

Don't you dare go Hollow

project_note

Clone
★ 0

0 watching0 forksRust3.6 MiBc49f5e7Tahinli1 month ago2 commits

editor.css1146 lines, 24.6 KiBHistoryRawDownload
1/* from prosemirror-view/style/prosemirror.css (MIT) */
2.ProseMirror {
3 position: relative;
4}
5
6.ProseMirror {
7 word-wrap: break-word;
8 white-space: pre-wrap;
9 white-space: break-spaces;
10 -webkit-font-variant-ligatures: none;
11 font-variant-ligatures: none;
12 font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
13}
14
15.ProseMirror pre {
16 white-space: pre-wrap;
17}
18
19.ProseMirror li {
20 position: relative;
21}
22
23.ProseMirror-hideselection *::selection { background: transparent; }
24.ProseMirror-hideselection *::-moz-selection { background: transparent; }
25.ProseMirror-hideselection { caret-color: transparent; }
26
27/* See https://code.haverbeke.berlin/prosemirror/prosemirror/issues/1421#issuecomment-1759320191 */
28.ProseMirror [draggable][contenteditable=false] { user-select: text }
29
30.ProseMirror-selectednode {
31 outline: 2px solid #8cf;
32}
33
34/* Make sure li selections wrap around markers */
35
36li.ProseMirror-selectednode {
37 outline: none;
38}
39
40li.ProseMirror-selectednode:after {
41 content: "";
42 position: absolute;
43 left: -32px;
44 right: -2px; top: -2px; bottom: -2px;
45 border: 2px solid #8cf;
46 pointer-events: none;
47}
48
49/* Protect against generic img rules */
50
51img.ProseMirror-separator {
52 display: inline !important;
53 border: none !important;
54 margin: 0 !important;
55}
56
57/* from prosemirror-gapcursor/style/gapcursor.css (MIT) */
58.ProseMirror-gapcursor {
59 display: none;
60 pointer-events: none;
61 position: absolute;
62}
63
64.ProseMirror-gapcursor:after {
65 content: "";
66 display: block;
67 position: absolute;
68 top: -2px;
69 width: 20px;
70 border-top: 1px solid black;
71 animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
72}
73
74@keyframes ProseMirror-cursor-blink {
75 to {
76 visibility: hidden;
77 }
78}
79
80.ProseMirror-focused .ProseMirror-gapcursor {
81 display: block;
82}
83
84/*
85 * Editor styles, tokens only ("Graphite & Highlighter", see styles.css). Light/dark is
86 * handled by the theme variables themselves. Fallbacks are the light values.
87 * Type: Atkinson Hyperlegible Next (UI and body), Atkinson Hyperlegible Mono (meta, keycaps, code).
88 */
89
90.sr-only {
91 position: absolute;
92 width: 1px;
93 height: 1px;
94 padding: 0;
95 margin: -1px;
96 overflow: hidden;
97 clip: rect(0, 0, 0, 0);
98 white-space: nowrap;
99 border: 0;
100}
101
102/* ---- Keycaps (every visible command shows its shortcut as these) ---- */
103
104.keycaps {
105 display: inline-flex;
106 align-items: center;
107 gap: 3px;
108 margin-inline-start: 6px;
109 vertical-align: middle;
110}
111
112.keycap {
113 display: inline-flex;
114 align-items: center;
115 justify-content: center;
116 min-width: 18px;
117 height: 18px;
118 padding: 0 4px;
119 border: 1px solid var(--border, #e3e5ea);
120 border-bottom-width: 2px;
121 border-radius: 6px;
122 background: var(--keycap-bg, #ffffff);
123 color: var(--muted-foreground, #5b6270);
124 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
125 font-size: 11px;
126 font-weight: 500;
127 line-height: 1;
128 font-variant-numeric: tabular-nums;
129}
130
131/* ---- Tooltips (toolbar and bubble buttons) ---- */
132
133.tip {
134 position: absolute;
135 top: calc(100% + 6px);
136 left: 50%;
137 z-index: 40;
138 display: flex;
139 align-items: center;
140 flex-wrap: wrap;
141 gap: 2px;
142 max-width: 240px;
143 padding: 4px 6px 4px 8px;
144 border: 1px solid var(--border, #e3e5ea);
145 border-radius: 10px;
146 background: var(--popover, #ffffff);
147 color: var(--popover-foreground, #16181d);
148 box-shadow: var(--shadow-float, 0 8px 24px rgb(0 0 0 / 0.12));
149 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
150 font-size: 12px;
151 font-weight: 500;
152 line-height: 16px;
153 white-space: nowrap;
154 pointer-events: none;
155 opacity: 0;
156 transform: translate(-50%, -2px);
157 transition:
158 opacity 150ms ease-out,
159 transform 150ms ease-out;
160}
161
162.tip .keycaps {
163 margin-inline-start: 4px;
164}
165
166.tip-reason {
167 display: none;
168 flex-basis: 100%;
169 color: var(--muted-foreground, #5b6270);
170 font-weight: 400;
171}
172
173.editor-toolbar-btn:disabled .tip-reason {
174 display: block;
175}
176
177.editor-toolbar-btn:hover .tip,
178.editor-toolbar-btn:focus-visible .tip,
179.bubble-btn:hover .tip,
180.bubble-btn:focus-visible .tip {
181 opacity: 1;
182 transform: translate(-50%, 0);
183 transition-delay: 300ms;
184}
185
186.bubble .tip {
187 top: auto;
188 bottom: calc(100% + 6px);
189}
190
191/* ---- Sync status pill (in the note header's #sync-slot) ---- */
192
193#sync-status {
194 display: inline-flex;
195 align-items: center;
196 gap: 6px;
197 height: 24px;
198 padding: 0 10px 0 8px;
199 border: 1px solid var(--border, #e3e5ea);
200 border-radius: 999px;
201 background: var(--card, #ffffff);
202 color: var(--muted-foreground, #5b6270);
203 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
204 font-size: 12px;
205 font-weight: 400;
206 line-height: 16px;
207 white-space: nowrap;
208 /* No transition: the pill changes while the user types, and animating it costs frames. */
209 contain: layout paint;
210}
211
212#sync-status::before {
213 content: "";
214 width: 6px;
215 height: 6px;
216 border-radius: 50%;
217 background: currentColor;
218 flex: none;
219}
220
221#sync-status .labels {
222 display: inline-grid;
223}
224
225#sync-status .labels > span {
226 grid-area: 1 / 1;
227 visibility: hidden;
228}
229
230#sync-status[data-state="saved"] [data-label="saved"],
231#sync-status[data-state="saving"] [data-label="saving"],
232#sync-status[data-state="connecting"] [data-label="connecting"],
233#sync-status[data-state="reconnecting"] [data-label="reconnecting"],
234#sync-status[data-state="local"] [data-label="local"] {
235 visibility: visible;
236}
237
238#sync-status[data-state="saved"] {
239 color: var(--ok, #1f7a4d);
240}
241
242#sync-status[data-state="saving"] {
243 color: var(--muted-foreground, #5b6270);
244}
245
246#sync-status[data-state="local"],
247#sync-status[data-state="reconnecting"] {
248 color: var(--warn, #9a5b00);
249}
250
251/* ---- Note header: one row, the formatting toolbar sits inside it ---- */
252
253#note-header {
254 container: note-header / inline-size;
255}
256
257/* ---- Toolbar: compact, icons only, one line (groups drop out when the row is narrow) ---- */
258
259.editor-toolbar {
260 display: flex;
261 flex: 0 0 auto;
262 flex-wrap: nowrap;
263 align-items: center;
264 gap: 2px;
265}
266
267.editor-toolbar-group {
268 display: flex;
269 align-items: center;
270 gap: 2px;
271}
272
273.editor-toolbar-group + .editor-toolbar-group::before {
274 content: "";
275 width: 1px;
276 height: 16px;
277 margin: 0 4px;
278 background: var(--border, #e3e5ea);
279}
280
281/* Lower-priority commands leave the bar as the header narrows, so the title keeps
282 at least 8rem. They stay reachable through the slash menu (/) and markdown shortcuts. */
283@container note-header (max-width: 879px) {
284 .note-crumb-notebook {
285 display: none;
286 }
287}
288
289@container note-header (max-width: 779px) {
290 .editor-toolbar-group[data-group="blocks"] {
291 display: none;
292 }
293}
294
295@container note-header (max-width: 619px) {
296 .editor-toolbar-btn[data-command="h1"],
297 .editor-toolbar-btn[data-command="h2"],
298 .editor-toolbar-btn[data-command="h3"] {
299 display: none;
300 }
301}
302
303@container note-header (max-width: 559px) {
304 #sync-status {
305 gap: 0;
306 padding: 0 8px;
307 font-size: 0;
308 }
309}
310
311@container note-header (max-width: 469px) {
312 .editor-toolbar-group[data-group="history"] {
313 display: none;
314 }
315}
316
317@container note-header (max-width: 419px) {
318 .editor-toolbar-btn[data-command="paragraph"],
319 .editor-toolbar-group[data-group="headings"] {
320 display: none;
321 }
322 .note-crumb {
323 min-width: 6rem;
324 }
325}
326
327.editor-toolbar-btn {
328 position: relative;
329 display: inline-grid;
330 place-items: center;
331 width: 28px;
332 height: 28px;
333 margin: 0;
334 padding: 0;
335 border: 0;
336 border-radius: 6px;
337 background: transparent;
338 color: var(--muted-foreground, #5b6270);
339 cursor: pointer;
340 transition:
341 background-color 150ms ease-out,
342 color 150ms ease-out;
343}
344
345.editor-toolbar-icon {
346 display: grid;
347 place-items: center;
348}
349
350.editor-toolbar-icon svg {
351 display: block;
352}
353
354.editor-toolbar-btn:hover:not(:disabled) {
355 background: var(--sidebar-accent, #e3e6eb);
356 color: var(--foreground, #16181d);
357}
358
359.editor-toolbar-btn[aria-pressed="true"] {
360 background: var(--active-row, #d9ebd3);
361 color: var(--active-row-foreground, #1f3d22);
362}
363
364/* Recording: the record button turns the destructive token while the mic is live. */
365.editor-toolbar-btn[data-recording="true"],
366.editor-toolbar-btn[data-recording="true"]:hover:not(:disabled) {
367 background: var(--destructive, #b3261e);
368 color: var(--destructive-foreground, #ffffff);
369}
370
371.editor-rec-time {
372 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
373 font-size: 11px;
374 font-variant-numeric: tabular-nums;
375 color: var(--muted-foreground, #5b6270);
376}
377
378.editor-rec-time[hidden] {
379 display: none;
380}
381
382.editor-media-status {
383 min-width: 0;
384 overflow: hidden;
385 font-size: 11px;
386 color: var(--destructive, #b3261e);
387 text-overflow: ellipsis;
388 white-space: nowrap;
389}
390
391.editor-toolbar-btn:disabled {
392 opacity: 0.4;
393 cursor: not-allowed;
394}
395
396.editor-toolbar-btn:focus-visible,
397.bubble-btn:focus-visible,
398.btn:focus-visible,
399.link-input:focus-visible,
400.slash-item:focus-visible {
401 outline: 2px solid var(--ring, #8a5a00);
402 outline-offset: 2px;
403}
404
405/* ---- Floating surfaces: bubble, link popover, slash menu ---- */
406
407.bubble,
408.popover {
409 position: fixed;
410 z-index: 50;
411 color: var(--popover-foreground, #16181d);
412 background: var(--popover, #ffffff);
413 border: 1px solid var(--border, #e3e5ea);
414 border-radius: 10px;
415 box-shadow: var(--shadow-float, 0 8px 24px rgb(0 0 0 / 0.12));
416 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
417 font-size: 14px;
418 line-height: 20px;
419}
420
421.bubble[hidden],
422.popover[hidden],
423.link-view[hidden],
424.link-edit[hidden],
425.link-error[hidden] {
426 display: none;
427}
428
429.bubble {
430 display: flex;
431 align-items: center;
432 gap: 2px;
433 padding: 4px;
434}
435
436.bubble-btn {
437 position: relative;
438 display: inline-grid;
439 place-items: center;
440 min-width: 28px;
441 height: 28px;
442 margin: 0;
443 padding: 0 6px;
444 border: 0;
445 border-radius: 6px;
446 background: transparent;
447 color: var(--foreground, #16181d);
448 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
449 font-size: 13px;
450 font-weight: 700;
451 line-height: 1;
452 cursor: pointer;
453 transition: background-color 150ms ease-out;
454}
455
456.bubble-btn:hover:not(:disabled) {
457 background: var(--sidebar-accent, #e3e6eb);
458}
459
460.bubble-btn[aria-pressed="true"] {
461 background: var(--active-row, #d9ebd3);
462}
463
464.bubble-btn:disabled {
465 opacity: 0.4;
466 cursor: not-allowed;
467}
468
469.bubble-btn[data-command="italic"] .bubble-glyph {
470 font-style: italic;
471 font-weight: 500;
472}
473
474.bubble-btn[data-command="bold"] .bubble-glyph {
475 font-weight: 800;
476}
477
478.bubble-btn[data-command="code"] .bubble-glyph {
479 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
480 font-size: 12px;
481 font-weight: 500;
482}
483
484.link-popover {
485 width: min(360px, calc(100vw - 16px));
486 box-sizing: border-box;
487 padding: 10px;
488}
489
490.link-row {
491 display: flex;
492 gap: 6px;
493}
494
495.link-input {
496 flex: 1;
497 min-width: 0;
498 height: 32px;
499 padding: 0 10px;
500 border: 1px solid var(--border, #e3e5ea);
501 border-radius: 6px;
502 background: var(--card, #ffffff);
503 color: var(--foreground, #16181d);
504 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
505 font-size: 13px;
506}
507
508.link-input[aria-invalid="true"] {
509 border-color: var(--bad, #b3261e);
510}
511
512.link-input::placeholder {
513 color: var(--muted-foreground, #5b6270);
514}
515
516.link-error {
517 margin: 6px 0 0;
518 color: var(--bad, #b3261e);
519 font-size: 12px;
520 line-height: 16px;
521}
522
523.link-actions {
524 display: flex;
525 flex-wrap: wrap;
526 gap: 6px;
527 margin-top: 8px;
528}
529
530.link-view {
531 display: grid;
532 gap: 2px;
533}
534
535.link-href {
536 display: block;
537 color: var(--link, #8a5a00);
538 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
539 font-size: 13px;
540 line-height: 18px;
541 overflow-wrap: anywhere;
542}
543
544.btn {
545 display: inline-flex;
546 align-items: center;
547 gap: 6px;
548 height: 28px;
549 padding: 0 10px;
550 border: 1px solid var(--border, #e3e5ea);
551 border-radius: 6px;
552 background: var(--card, #ffffff);
553 color: var(--foreground, #16181d);
554 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
555 font-size: 13px;
556 font-weight: 500;
557 line-height: 1;
558 cursor: pointer;
559 transition: background-color 150ms ease-out;
560}
561
562.btn:hover:not(:disabled) {
563 background: var(--sidebar-accent, #e3e6eb);
564}
565
566.btn:disabled {
567 opacity: 0.45;
568 cursor: not-allowed;
569}
570
571.btn-primary {
572 border-color: transparent;
573 background: var(--primary, #f2b600);
574 color: var(--primary-foreground, #16181d);
575}
576
577.btn-primary:hover:not(:disabled) {
578 background: var(--primary, #f2b600);
579 opacity: 0.9;
580}
581
582.btn-primary .keycaps {
583 margin-inline-start: 2px;
584}
585
586.btn-primary .keycap {
587 border-color: transparent;
588 border-bottom-color: color-mix(in srgb, var(--primary-foreground, #16181d) 35%, transparent);
589 background: transparent;
590 color: inherit;
591}
592
593.slash-menu {
594 width: 264px;
595 max-width: calc(100vw - 16px);
596 box-sizing: border-box;
597 padding: 4px;
598}
599
600.slash-list {
601 max-height: 288px;
602 overflow-y: auto;
603}
604
605.slash-item {
606 display: flex;
607 align-items: center;
608 justify-content: space-between;
609 gap: 12px;
610 min-height: 32px;
611 padding: 0 8px;
612 border-radius: 6px;
613 color: var(--foreground, #16181d);
614 cursor: pointer;
615}
616
617.slash-item[aria-selected="true"] {
618 background: var(--active-row, #d9ebd3);
619}
620
621.slash-item .keycaps {
622 margin-inline-start: 0;
623}
624
625.slash-empty {
626 padding: 8px;
627 color: var(--muted-foreground, #5b6270);
628 font-size: 13px;
629}
630
631.slash-footer {
632 display: flex;
633 flex-wrap: wrap;
634 align-items: center;
635 gap: 2px;
636 margin-top: 4px;
637 padding: 6px 8px 2px;
638 border-top: 1px solid var(--border, #e3e5ea);
639 color: var(--muted-foreground, #5b6270);
640 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
641 font-size: 11px;
642 line-height: 16px;
643}
644
645.slash-footer .keycaps {
646 margin-inline-start: 0;
647}
648
649/* Note suggestions: long titles are cut with an ellipsis */
650
651.note-menu .slash-label {
652 min-width: 0;
653 overflow: hidden;
654 text-overflow: ellipsis;
655 white-space: nowrap;
656}
657
658/* ---- Editor surface ---- */
659
660#editor {
661 max-width: calc(68ch + 48px);
662 margin: 0 auto;
663 padding: 32px 24px 30vh;
664 box-sizing: border-box;
665}
666
667#editor .ProseMirror {
668 min-height: 60vh;
669 max-width: 68ch;
670 margin: 0 auto;
671 outline: none;
672 color: var(--foreground, #16181d);
673 caret-color: var(--foreground, #16181d);
674 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
675 font-size: 17px;
676 line-height: 1.65;
677 overflow-wrap: break-word;
678 word-wrap: break-word;
679 font-variant-ligatures: common-ligatures;
680}
681
682#editor .ProseMirror:focus,
683#editor .ProseMirror:focus-visible {
684 outline: none;
685}
686
687/* Top-level blocks sit in pages (view.rs); spacing runs across page boundaries.
688 :where keeps the specificity of the plain `.ProseMirror > * + *` rules. */
689#editor .ProseMirror :where(.pm-page) > * + *,
690#editor .ProseMirror :where(.pm-page + .pm-page) > :where(:first-child) {
691 margin-top: 0.75em;
692}
693
694#editor .ProseMirror ::selection,
695#editor .ProseMirror::selection {
696 background: var(--mark, #ffe08a);
697 color: var(--foreground, #16181d);
698}
699
700#editor .ProseMirror p {
701 margin: 0;
702}
703
704/* Embedded media: images scale to the column, audio and video are their own blocks. */
705#editor .ProseMirror img {
706 max-width: 100%;
707}
708
709#editor .ProseMirror audio.note-media {
710 display: block;
711 width: 100%;
712 max-width: 32rem;
713}
714
715#editor .ProseMirror video.note-media {
716 display: block;
717 max-width: 100%;
718}
719
720/* A recording take: its audio and continue button, until the take is live or lost. Then the
721 label stands in for both. The state is an attribute, so the editor never rebuilds the span. */
722#editor .ProseMirror span.note-take {
723 display: flex;
724 flex-wrap: wrap;
725 align-items: center;
726 gap: 0.5rem;
727}
728
729#editor .ProseMirror span.note-take audio {
730 flex: 1 1 16rem;
731 max-width: 32rem;
732}
733
734#editor .ProseMirror span.note-take .note-take-continue {
735 font: inherit;
736 font-size: 0.875rem;
737 padding: 0.25rem 0.625rem;
738 border: 1px solid var(--border, #d4d7de);
739 border-radius: 0.375rem;
740 background: var(--background, #fff);
741 color: var(--foreground, #1f2330);
742 cursor: pointer;
743}
744
745#editor .ProseMirror span.note-take[data-take-state="live"] > audio,
746#editor .ProseMirror span.note-take[data-take-state="live"] > .note-take-continue,
747#editor .ProseMirror span.note-take[data-take-state="lost"] > audio,
748#editor .ProseMirror span.note-take[data-take-state="lost"] > .note-take-continue {
749 display: none;
750}
751
752#editor .ProseMirror span.note-take[data-take-state="live"]::before,
753#editor .ProseMirror span.note-take[data-take-state="lost"]::before {
754 color: var(--muted-foreground, #5b6270);
755 font-size: 0.875rem;
756}
757
758#editor .ProseMirror span.note-take[data-take-state="live"]::before {
759 content: attr(data-recording-label);
760}
761
762#editor .ProseMirror span.note-take[data-take-state="lost"]::before {
763 content: attr(data-lost-label);
764}
765
766/* Placeholder: shown by the placeholder decoration while the note is empty. */
767#editor .ProseMirror p.is-placeholder::before {
768 content: attr(data-placeholder);
769 float: left;
770 height: 0;
771 color: var(--muted-foreground, #5b6270);
772 pointer-events: none;
773}
774
775/* Headings: 30/36, 23/30, 19/26, all bold. */
776#editor .ProseMirror h1,
777#editor .ProseMirror h2,
778#editor .ProseMirror h3 {
779 margin: 0;
780 color: var(--foreground, #16181d);
781 font-weight: 700;
782 letter-spacing: -0.01em;
783}
784
785#editor .ProseMirror :where(.pm-page) > * + h1,
786#editor .ProseMirror :where(.pm-page) > * + h2,
787#editor .ProseMirror :where(.pm-page) > * + h3,
788#editor .ProseMirror :where(.pm-page + .pm-page) > h1:where(:first-child),
789#editor .ProseMirror :where(.pm-page + .pm-page) > h2:where(:first-child),
790#editor .ProseMirror :where(.pm-page + .pm-page) > h3:where(:first-child) {
791 margin-top: 1.4em;
792}
793
794#editor .ProseMirror h1 {
795 font-size: 30px;
796 line-height: 36px;
797}
798
799#editor .ProseMirror h2 {
800 font-size: 23px;
801 line-height: 30px;
802}
803
804#editor .ProseMirror h3 {
805 font-size: 19px;
806 line-height: 26px;
807}
808
809/* Lists */
810
811#editor .ProseMirror ul,
812#editor .ProseMirror ol {
813 margin: 0;
814 padding-left: 1.6em;
815}
816
817#editor .ProseMirror ul {
818 list-style: disc;
819}
820
821#editor .ProseMirror ol {
822 list-style: decimal;
823}
824
825#editor .ProseMirror ul ul {
826 list-style: circle;
827}
828
829#editor .ProseMirror ul ul ul {
830 list-style: square;
831}
832
833#editor .ProseMirror li {
834 margin: 0.2em 0;
835}
836
837#editor .ProseMirror li::marker {
838 color: var(--muted-foreground, #5b6270);
839}
840
841#editor .ProseMirror li > p + p,
842#editor .ProseMirror li > * + ul,
843#editor .ProseMirror li > * + ol {
844 margin-top: 0.2em;
845}
846
847/* A list or quote cut by a page boundary (view.rs): the part on the later page has
848 pm-cont, the earlier part pm-more; together they look like one element. */
849#editor .ProseMirror .pm-page > .pm-cont,
850#editor .ProseMirror li.pm-cont,
851#editor .ProseMirror .pm-cont > li:first-child {
852 margin-top: 0;
853}
854
855#editor .ProseMirror li.pm-cont {
856 list-style-type: none;
857}
858
859#editor .ProseMirror li.pm-more {
860 margin-bottom: 0;
861}
862
863#editor .ProseMirror blockquote.pm-cont {
864 padding-top: 0;
865}
866
867#editor .ProseMirror blockquote.pm-more {
868 padding-bottom: 0;
869}
870
871/* Quote */
872
873#editor .ProseMirror blockquote {
874 margin: 0;
875 padding: 2px 0 2px 16px;
876 border-left: 3px solid var(--border, #e3e5ea);
877 color: var(--muted-foreground, #5b6270);
878}
879
880/* Code: mono on the background token, hairline border */
881
882#editor .ProseMirror code {
883 padding: 1px 5px;
884 border: 1px solid var(--border, #e3e5ea);
885 border-radius: 6px;
886 background: var(--background, #f5f6f8);
887 color: var(--foreground, #16181d);
888 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
889 font-size: 0.88em;
890}
891
892#editor .ProseMirror pre {
893 margin: 0;
894 padding: 12px 14px;
895 border: 1px solid var(--border, #e3e5ea);
896 border-radius: 10px;
897 background: var(--background, #f5f6f8);
898 color: var(--foreground, #16181d);
899 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
900 font-size: 14px;
901 line-height: 22px;
902 overflow-x: auto;
903 white-space: pre;
904}
905
906#editor .ProseMirror pre code {
907 display: block;
908 padding: 0;
909 border: 0;
910 border-radius: 0;
911 background: none;
912 font-size: inherit;
913}
914
915/* Long code blocks render as line chunks (view.rs); off-screen ones skip layout,
916 sized by their line count until first shown. */
917#editor .ProseMirror .code-chunk {
918 content-visibility: auto;
919 contain-intrinsic-size: auto none auto calc(var(--lines) * 22px);
920}
921
922/* A chunk far from the viewport is an empty placeholder of its height. */
923#editor .ProseMirror .code-chunk:empty {
924 height: calc(var(--lines) * 22px);
925}
926
927/* Code blocks: a header bar (ui/codeblock.rs) sits over the top 34px of each pre */
928
929#editor .ProseMirror pre {
930 padding-top: 46px;
931}
932
933.code-layer {
934 position: absolute;
935 inset: 0;
936 pointer-events: none;
937}
938
939.code-layer[hidden] {
940 display: none;
941}
942
943.code-head {
944 position: absolute;
945 box-sizing: border-box;
946 display: flex;
947 align-items: center;
948 gap: 4px;
949 height: 34px;
950 padding: 0 6px 0 10px;
951 border-bottom: 1px solid var(--border, #e3e5ea);
952 border-radius: 9px 9px 0 0;
953 background: color-mix(in srgb, var(--foreground, #16181d) 3%, transparent);
954 color: var(--muted-foreground, #5b6270);
955 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
956 font-size: 12px;
957 pointer-events: auto;
958}
959
960.code-head[hidden] {
961 display: none;
962}
963
964.code-lang {
965 min-width: 0;
966 max-width: 14rem;
967 height: 24px;
968 margin: 0;
969 padding: 0 4px;
970 border: 0;
971 border-radius: 6px;
972 background: transparent;
973 color: inherit;
974 font: inherit;
975 cursor: pointer;
976}
977
978.code-lang:hover {
979 background: var(--sidebar-accent, #e3e6eb);
980 color: var(--foreground, #16181d);
981}
982
983.code-lang option {
984 background: var(--background, #f5f6f8);
985 color: var(--foreground, #16181d);
986}
987
988.code-spacer {
989 flex: 1;
990 min-width: 4px;
991}
992
993.code-status {
994 min-width: 0;
995 overflow: hidden;
996 font-size: 11px;
997 text-overflow: ellipsis;
998 white-space: nowrap;
999}
1000
1001.code-btn {
1002 display: inline-grid;
1003 place-items: center;
1004 flex: none;
1005 width: 24px;
1006 height: 24px;
1007 margin: 0;
1008 padding: 0;
1009 border: 0;
1010 border-radius: 6px;
1011 background: transparent;
1012 color: var(--muted-foreground, #5b6270);
1013 cursor: pointer;
1014 transition:
1015 background-color 150ms ease-out,
1016 color 150ms ease-out;
1017}
1018
1019.code-btn svg {
1020 display: block;
1021}
1022
1023.code-btn:hover:not(:disabled) {
1024 background: var(--sidebar-accent, #e3e6eb);
1025 color: var(--foreground, #16181d);
1026}
1027
1028.code-btn[aria-pressed="true"] {
1029 background: var(--active-row, #d9ebd3);
1030 color: var(--active-row-foreground, #1f3d22);
1031}
1032
1033.code-btn:disabled {
1034 opacity: 0.4;
1035 cursor: not-allowed;
1036}
1037
1038.code-btn:focus-visible,
1039.code-lang:focus-visible {
1040 outline: 2px solid var(--ring, #8a5a00);
1041 outline-offset: 2px;
1042}
1043
1044/* Marks: search-style highlight */
1045
1046#editor .ProseMirror mark {
1047 padding: 0 0.1em;
1048 border-radius: 3px;
1049 background: var(--mark, #ffe08a);
1050 color: inherit;
1051}
1052
1053/* Links: accent ink with a quiet underline */
1054
1055#editor .ProseMirror a {
1056 color: var(--link, #8a5a00);
1057 text-decoration-line: underline;
1058 text-decoration-thickness: 1px;
1059 text-decoration-color: color-mix(in srgb, var(--link, #8a5a00) 45%, transparent);
1060 text-underline-offset: 3px;
1061 cursor: pointer;
1062}
1063
1064#editor .ProseMirror a:hover {
1065 text-decoration-color: var(--link, #8a5a00);
1066}
1067
1068/* Note links (href /notes/<id>): a tinted chip, underlined only on hover */
1069
1070#editor .ProseMirror a[href^="/notes/"] {
1071 padding: 0 0.2em;
1072 border-radius: 4px;
1073 background: color-mix(in srgb, var(--link, #8a5a00) 12%, transparent);
1074 text-decoration-line: none;
1075 box-decoration-break: clone;
1076 -webkit-box-decoration-break: clone;
1077}
1078
1079#editor .ProseMirror a[href^="/notes/"]:hover {
1080 text-decoration-line: underline;
1081}
1082
1083/* Horizontal rule */
1084
1085#editor .ProseMirror hr {
1086 margin: 2em 0;
1087 border: 0;
1088 border-top: 1px solid var(--border, #e3e5ea);
1089}
1090
1091#editor .ProseMirror hr.ProseMirror-selectednode {
1092 outline: 2px solid var(--ring, #8a5a00);
1093 outline-offset: 4px;
1094 border-radius: 2px;
1095}
1096
1097/* ---- Remote cursors and selections (loro-prosemirror classes) ---- */
1098
1099.ProseMirror-loro-cursor {
1100 position: relative;
1101 margin-left: -1px;
1102 margin-right: -1px;
1103 /* border-color is set inline per user */
1104 border-left: 2px solid;
1105 word-break: normal;
1106 pointer-events: none;
1107}
1108
1109/* Name label in the user's color, mono 11px. */
1110.ProseMirror-loro-cursor > div {
1111 position: absolute;
1112 top: -1.5em;
1113 left: -2px;
1114 padding: 0 5px;
1115 border-radius: 4px 4px 4px 0;
1116 /* background-color is set inline per user */
1117 color: #ffffff;
1118 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
1119 font-size: 11px;
1120 font-weight: 500;
1121 line-height: 16px;
1122 white-space: nowrap;
1123 user-select: none;
1124}
1125
1126.loro-selection {
1127 border-radius: 2px;
1128}
1129
1130@media (prefers-reduced-motion: reduce) {
1131 .editor-toolbar-btn,
1132 .bubble-btn,
1133 .btn,
1134 .tip {
1135 transition-duration: 0ms !important;
1136 transition-delay: 0ms !important;
1137 }
1138}
1139
1140@media (forced-colors: active) {
1141 .editor-toolbar-btn[aria-pressed="true"],
1142 .bubble-btn[aria-pressed="true"],
1143 .slash-item[aria-selected="true"] {
1144 outline: 2px solid CanvasText;
1145 }
1146}