forge
Explore
Log in

Don't you dare go Hollow

project_note

Clone
★ 0

0 watching0 forksJavaScript3.6 MiBe100df4Tahinli1 month ago1 commit

editor.css800 lines, 16.4 KiBHistoryRawDownload
1@import "prosemirror-view/style/prosemirror.css";
2@import "prosemirror-gapcursor/style/gapcursor.css";
3
4/*
5 * Editor styles, tokens only ("Graphite & Highlighter", see styles.css). Light/dark is
6 * handled by the theme variables themselves. Fallbacks are the light values.
7 * Type: Atkinson Hyperlegible Next (UI and body), Atkinson Hyperlegible Mono (meta, keycaps, code).
8 */
9
10.sr-only {
11 position: absolute;
12 width: 1px;
13 height: 1px;
14 padding: 0;
15 margin: -1px;
16 overflow: hidden;
17 clip: rect(0, 0, 0, 0);
18 white-space: nowrap;
19 border: 0;
20}
21
22/* ---- Keycaps (every visible command shows its shortcut as these) ---- */
23
24.keycaps {
25 display: inline-flex;
26 align-items: center;
27 gap: 3px;
28 margin-inline-start: 6px;
29 vertical-align: middle;
30}
31
32.keycap {
33 display: inline-flex;
34 align-items: center;
35 justify-content: center;
36 min-width: 18px;
37 height: 18px;
38 padding: 0 4px;
39 border: 1px solid var(--border, #e3e5ea);
40 border-bottom-width: 2px;
41 border-radius: 6px;
42 background: var(--keycap-bg, #ffffff);
43 color: var(--muted-foreground, #5b6270);
44 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
45 font-size: 11px;
46 font-weight: 500;
47 line-height: 1;
48 font-variant-numeric: tabular-nums;
49}
50
51/* ---- Tooltips (toolbar and bubble buttons) ---- */
52
53.tip {
54 position: absolute;
55 top: calc(100% + 6px);
56 left: 50%;
57 z-index: 40;
58 display: flex;
59 align-items: center;
60 flex-wrap: wrap;
61 gap: 2px;
62 max-width: 240px;
63 padding: 4px 6px 4px 8px;
64 border: 1px solid var(--border, #e3e5ea);
65 border-radius: 10px;
66 background: var(--popover, #ffffff);
67 color: var(--popover-foreground, #16181d);
68 box-shadow: var(--shadow-float, 0 8px 24px rgb(0 0 0 / 0.12));
69 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
70 font-size: 12px;
71 font-weight: 500;
72 line-height: 16px;
73 white-space: nowrap;
74 pointer-events: none;
75 opacity: 0;
76 transform: translate(-50%, -2px);
77 transition:
78 opacity 150ms ease-out,
79 transform 150ms ease-out;
80}
81
82.tip .keycaps {
83 margin-inline-start: 4px;
84}
85
86.tip-reason {
87 display: none;
88 flex-basis: 100%;
89 color: var(--muted-foreground, #5b6270);
90 font-weight: 400;
91}
92
93.editor-toolbar-btn:disabled .tip-reason {
94 display: block;
95}
96
97.editor-toolbar-btn:hover .tip,
98.editor-toolbar-btn:focus-visible .tip,
99.bubble-btn:hover .tip,
100.bubble-btn:focus-visible .tip {
101 opacity: 1;
102 transform: translate(-50%, 0);
103 transition-delay: 300ms;
104}
105
106.bubble .tip {
107 top: auto;
108 bottom: calc(100% + 6px);
109}
110
111/* ---- Sync status pill (in the note header's #sync-slot) ---- */
112
113#sync-status {
114 display: inline-flex;
115 align-items: center;
116 gap: 6px;
117 height: 24px;
118 padding: 0 10px 0 8px;
119 border: 1px solid var(--border, #e3e5ea);
120 border-radius: 999px;
121 background: var(--card, #ffffff);
122 color: var(--muted-foreground, #5b6270);
123 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
124 font-size: 12px;
125 font-weight: 400;
126 line-height: 16px;
127 white-space: nowrap;
128 transition: color 150ms ease-out;
129}
130
131#sync-status::before {
132 content: "";
133 width: 6px;
134 height: 6px;
135 border-radius: 50%;
136 background: currentColor;
137 flex: none;
138}
139
140#sync-status[data-state="saved"] {
141 color: var(--ok, #1f7a4d);
142}
143
144#sync-status[data-state="saving"] {
145 color: var(--muted-foreground, #5b6270);
146}
147
148#sync-status[data-state="local"],
149#sync-status[data-state="reconnecting"] {
150 color: var(--warn, #9a5b00);
151}
152
153/* ---- Note header: one row, the formatting toolbar sits inside it ---- */
154
155#note-header {
156 container: note-header / inline-size;
157}
158
159/* ---- Toolbar: compact, icons only, one line (groups drop out when the row is narrow) ---- */
160
161.editor-toolbar {
162 display: flex;
163 flex: 0 0 auto;
164 flex-wrap: nowrap;
165 align-items: center;
166 gap: 2px;
167}
168
169.editor-toolbar-group {
170 display: flex;
171 align-items: center;
172 gap: 2px;
173}
174
175.editor-toolbar-group + .editor-toolbar-group::before {
176 content: "";
177 width: 1px;
178 height: 16px;
179 margin: 0 4px;
180 background: var(--border, #e3e5ea);
181}
182
183/* Lower-priority commands leave the bar as the header narrows, so the title keeps
184 at least 8rem. They stay reachable through the slash menu (/) and markdown shortcuts. */
185@container note-header (max-width: 879px) {
186 .note-crumb-notebook {
187 display: none;
188 }
189}
190
191@container note-header (max-width: 779px) {
192 .editor-toolbar-group[data-group="blocks"] {
193 display: none;
194 }
195}
196
197@container note-header (max-width: 619px) {
198 .editor-toolbar-btn[data-command="h1"],
199 .editor-toolbar-btn[data-command="h2"],
200 .editor-toolbar-btn[data-command="h3"] {
201 display: none;
202 }
203}
204
205@container note-header (max-width: 559px) {
206 #sync-status {
207 gap: 0;
208 padding: 0 8px;
209 font-size: 0;
210 }
211}
212
213@container note-header (max-width: 469px) {
214 .editor-toolbar-group[data-group="history"] {
215 display: none;
216 }
217}
218
219@container note-header (max-width: 419px) {
220 .editor-toolbar-btn[data-command="paragraph"],
221 .editor-toolbar-group[data-group="headings"] {
222 display: none;
223 }
224 .note-crumb {
225 min-width: 6rem;
226 }
227}
228
229.editor-toolbar-btn {
230 position: relative;
231 display: inline-grid;
232 place-items: center;
233 width: 28px;
234 height: 28px;
235 margin: 0;
236 padding: 0;
237 border: 0;
238 border-radius: 6px;
239 background: transparent;
240 color: var(--muted-foreground, #5b6270);
241 cursor: pointer;
242 transition:
243 background-color 150ms ease-out,
244 color 150ms ease-out;
245}
246
247.editor-toolbar-icon {
248 display: grid;
249 place-items: center;
250}
251
252.editor-toolbar-icon svg {
253 display: block;
254}
255
256.editor-toolbar-btn:hover:not(:disabled) {
257 background: var(--sidebar-accent, #e3e6eb);
258 color: var(--foreground, #16181d);
259}
260
261.editor-toolbar-btn[aria-pressed="true"] {
262 background: var(--active-row, #d9ebd3);
263 color: var(--active-row-foreground, #1f3d22);
264}
265
266.editor-toolbar-btn:disabled {
267 opacity: 0.4;
268 cursor: not-allowed;
269}
270
271.editor-toolbar-btn:focus-visible,
272.bubble-btn:focus-visible,
273.btn:focus-visible,
274.link-input:focus-visible,
275.slash-item:focus-visible {
276 outline: 2px solid var(--ring, #8a5a00);
277 outline-offset: 2px;
278}
279
280/* ---- Floating surfaces: bubble, link popover, slash menu ---- */
281
282.bubble,
283.popover {
284 position: fixed;
285 z-index: 50;
286 color: var(--popover-foreground, #16181d);
287 background: var(--popover, #ffffff);
288 border: 1px solid var(--border, #e3e5ea);
289 border-radius: 10px;
290 box-shadow: var(--shadow-float, 0 8px 24px rgb(0 0 0 / 0.12));
291 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
292 font-size: 14px;
293 line-height: 20px;
294}
295
296.bubble[hidden],
297.popover[hidden],
298.link-view[hidden],
299.link-edit[hidden],
300.link-error[hidden] {
301 display: none;
302}
303
304.bubble {
305 display: flex;
306 align-items: center;
307 gap: 2px;
308 padding: 4px;
309}
310
311.bubble-btn {
312 position: relative;
313 display: inline-grid;
314 place-items: center;
315 min-width: 28px;
316 height: 28px;
317 margin: 0;
318 padding: 0 6px;
319 border: 0;
320 border-radius: 6px;
321 background: transparent;
322 color: var(--foreground, #16181d);
323 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
324 font-size: 13px;
325 font-weight: 700;
326 line-height: 1;
327 cursor: pointer;
328 transition: background-color 150ms ease-out;
329}
330
331.bubble-btn:hover:not(:disabled) {
332 background: var(--sidebar-accent, #e3e6eb);
333}
334
335.bubble-btn[aria-pressed="true"] {
336 background: var(--active-row, #d9ebd3);
337}
338
339.bubble-btn:disabled {
340 opacity: 0.4;
341 cursor: not-allowed;
342}
343
344.bubble-btn[data-command="italic"] .bubble-glyph {
345 font-style: italic;
346 font-weight: 500;
347}
348
349.bubble-btn[data-command="bold"] .bubble-glyph {
350 font-weight: 800;
351}
352
353.bubble-btn[data-command="code"] .bubble-glyph {
354 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
355 font-size: 12px;
356 font-weight: 500;
357}
358
359.link-popover {
360 width: min(360px, calc(100vw - 16px));
361 box-sizing: border-box;
362 padding: 10px;
363}
364
365.link-row {
366 display: flex;
367 gap: 6px;
368}
369
370.link-input {
371 flex: 1;
372 min-width: 0;
373 height: 32px;
374 padding: 0 10px;
375 border: 1px solid var(--border, #e3e5ea);
376 border-radius: 6px;
377 background: var(--card, #ffffff);
378 color: var(--foreground, #16181d);
379 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
380 font-size: 13px;
381}
382
383.link-input[aria-invalid="true"] {
384 border-color: var(--bad, #b3261e);
385}
386
387.link-input::placeholder {
388 color: var(--muted-foreground, #5b6270);
389}
390
391.link-error {
392 margin: 6px 0 0;
393 color: var(--bad, #b3261e);
394 font-size: 12px;
395 line-height: 16px;
396}
397
398.link-actions {
399 display: flex;
400 flex-wrap: wrap;
401 gap: 6px;
402 margin-top: 8px;
403}
404
405.link-view {
406 display: grid;
407 gap: 2px;
408}
409
410.link-href {
411 display: block;
412 color: var(--link, #8a5a00);
413 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
414 font-size: 13px;
415 line-height: 18px;
416 overflow-wrap: anywhere;
417}
418
419.btn {
420 display: inline-flex;
421 align-items: center;
422 gap: 6px;
423 height: 28px;
424 padding: 0 10px;
425 border: 1px solid var(--border, #e3e5ea);
426 border-radius: 6px;
427 background: var(--card, #ffffff);
428 color: var(--foreground, #16181d);
429 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
430 font-size: 13px;
431 font-weight: 500;
432 line-height: 1;
433 cursor: pointer;
434 transition: background-color 150ms ease-out;
435}
436
437.btn:hover:not(:disabled) {
438 background: var(--sidebar-accent, #e3e6eb);
439}
440
441.btn:disabled {
442 opacity: 0.45;
443 cursor: not-allowed;
444}
445
446.btn-primary {
447 border-color: transparent;
448 background: var(--primary, #f2b600);
449 color: var(--primary-foreground, #16181d);
450}
451
452.btn-primary:hover:not(:disabled) {
453 background: var(--primary, #f2b600);
454 opacity: 0.9;
455}
456
457.btn-primary .keycaps {
458 margin-inline-start: 2px;
459}
460
461.btn-primary .keycap {
462 border-color: transparent;
463 border-bottom-color: color-mix(in srgb, var(--primary-foreground, #16181d) 35%, transparent);
464 background: transparent;
465 color: inherit;
466}
467
468.slash-menu {
469 width: 264px;
470 max-width: calc(100vw - 16px);
471 box-sizing: border-box;
472 padding: 4px;
473}
474
475.slash-list {
476 max-height: 288px;
477 overflow-y: auto;
478}
479
480.slash-item {
481 display: flex;
482 align-items: center;
483 justify-content: space-between;
484 gap: 12px;
485 min-height: 32px;
486 padding: 0 8px;
487 border-radius: 6px;
488 color: var(--foreground, #16181d);
489 cursor: pointer;
490}
491
492.slash-item[aria-selected="true"] {
493 background: var(--active-row, #d9ebd3);
494}
495
496.slash-item .keycaps {
497 margin-inline-start: 0;
498}
499
500.slash-empty {
501 padding: 8px;
502 color: var(--muted-foreground, #5b6270);
503 font-size: 13px;
504}
505
506.slash-footer {
507 display: flex;
508 flex-wrap: wrap;
509 align-items: center;
510 gap: 2px;
511 margin-top: 4px;
512 padding: 6px 8px 2px;
513 border-top: 1px solid var(--border, #e3e5ea);
514 color: var(--muted-foreground, #5b6270);
515 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
516 font-size: 11px;
517 line-height: 16px;
518}
519
520.slash-footer .keycaps {
521 margin-inline-start: 0;
522}
523
524/* Note suggestions: long titles are cut with an ellipsis */
525
526.note-menu .slash-label {
527 min-width: 0;
528 overflow: hidden;
529 text-overflow: ellipsis;
530 white-space: nowrap;
531}
532
533/* ---- Editor surface ---- */
534
535#editor {
536 max-width: calc(68ch + 48px);
537 margin: 0 auto;
538 padding: 32px 24px 30vh;
539 box-sizing: border-box;
540}
541
542#editor .ProseMirror {
543 min-height: 60vh;
544 max-width: 68ch;
545 margin: 0 auto;
546 outline: none;
547 color: var(--foreground, #16181d);
548 caret-color: var(--foreground, #16181d);
549 font-family: var(--font-sans, "Atkinson Hyperlegible Next", sans-serif);
550 font-size: 17px;
551 line-height: 1.65;
552 overflow-wrap: break-word;
553 word-wrap: break-word;
554 font-variant-ligatures: common-ligatures;
555}
556
557#editor .ProseMirror:focus,
558#editor .ProseMirror:focus-visible {
559 outline: none;
560}
561
562#editor .ProseMirror > * + * {
563 margin-top: 0.75em;
564}
565
566#editor .ProseMirror ::selection,
567#editor .ProseMirror::selection {
568 background: var(--mark, #ffe08a);
569 color: var(--foreground, #16181d);
570}
571
572#editor .ProseMirror p {
573 margin: 0;
574}
575
576/* Placeholder: shown by the placeholder decoration while the note is empty. */
577#editor .ProseMirror p.is-placeholder::before {
578 content: attr(data-placeholder);
579 float: left;
580 height: 0;
581 color: var(--muted-foreground, #5b6270);
582 pointer-events: none;
583}
584
585/* Headings: 30/36, 23/30, 19/26, all bold. */
586#editor .ProseMirror h1,
587#editor .ProseMirror h2,
588#editor .ProseMirror h3 {
589 margin: 0;
590 color: var(--foreground, #16181d);
591 font-weight: 700;
592 letter-spacing: -0.01em;
593}
594
595#editor .ProseMirror > * + h1,
596#editor .ProseMirror > * + h2,
597#editor .ProseMirror > * + h3 {
598 margin-top: 1.4em;
599}
600
601#editor .ProseMirror h1 {
602 font-size: 30px;
603 line-height: 36px;
604}
605
606#editor .ProseMirror h2 {
607 font-size: 23px;
608 line-height: 30px;
609}
610
611#editor .ProseMirror h3 {
612 font-size: 19px;
613 line-height: 26px;
614}
615
616/* Lists */
617
618#editor .ProseMirror ul,
619#editor .ProseMirror ol {
620 margin: 0;
621 padding-left: 1.6em;
622}
623
624#editor .ProseMirror ul {
625 list-style: disc;
626}
627
628#editor .ProseMirror ol {
629 list-style: decimal;
630}
631
632#editor .ProseMirror ul ul {
633 list-style: circle;
634}
635
636#editor .ProseMirror ul ul ul {
637 list-style: square;
638}
639
640#editor .ProseMirror li {
641 margin: 0.2em 0;
642}
643
644#editor .ProseMirror li::marker {
645 color: var(--muted-foreground, #5b6270);
646}
647
648#editor .ProseMirror li > p + p,
649#editor .ProseMirror li > * + ul,
650#editor .ProseMirror li > * + ol {
651 margin-top: 0.2em;
652}
653
654/* Quote */
655
656#editor .ProseMirror blockquote {
657 margin: 0;
658 padding: 2px 0 2px 16px;
659 border-left: 3px solid var(--border, #e3e5ea);
660 color: var(--muted-foreground, #5b6270);
661}
662
663/* Code: mono on the background token, hairline border */
664
665#editor .ProseMirror code {
666 padding: 1px 5px;
667 border: 1px solid var(--border, #e3e5ea);
668 border-radius: 6px;
669 background: var(--background, #f5f6f8);
670 color: var(--foreground, #16181d);
671 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
672 font-size: 0.88em;
673}
674
675#editor .ProseMirror pre {
676 margin: 0;
677 padding: 12px 14px;
678 border: 1px solid var(--border, #e3e5ea);
679 border-radius: 10px;
680 background: var(--background, #f5f6f8);
681 color: var(--foreground, #16181d);
682 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
683 font-size: 14px;
684 line-height: 22px;
685 overflow-x: auto;
686 white-space: pre;
687}
688
689#editor .ProseMirror pre code {
690 padding: 0;
691 border: 0;
692 border-radius: 0;
693 background: none;
694 font-size: inherit;
695}
696
697/* Marks: search-style highlight */
698
699#editor .ProseMirror mark {
700 padding: 0 0.1em;
701 border-radius: 3px;
702 background: var(--mark, #ffe08a);
703 color: inherit;
704}
705
706/* Links: accent ink with a quiet underline */
707
708#editor .ProseMirror a {
709 color: var(--link, #8a5a00);
710 text-decoration-line: underline;
711 text-decoration-thickness: 1px;
712 text-decoration-color: color-mix(in srgb, var(--link, #8a5a00) 45%, transparent);
713 text-underline-offset: 3px;
714 cursor: pointer;
715}
716
717#editor .ProseMirror a:hover {
718 text-decoration-color: var(--link, #8a5a00);
719}
720
721/* Note links (href /notes/<id>): a tinted chip, underlined only on hover */
722
723#editor .ProseMirror a[href^="/notes/"] {
724 padding: 0 0.2em;
725 border-radius: 4px;
726 background: color-mix(in srgb, var(--link, #8a5a00) 12%, transparent);
727 text-decoration-line: none;
728 box-decoration-break: clone;
729 -webkit-box-decoration-break: clone;
730}
731
732#editor .ProseMirror a[href^="/notes/"]:hover {
733 text-decoration-line: underline;
734}
735
736/* Horizontal rule */
737
738#editor .ProseMirror hr {
739 margin: 2em 0;
740 border: 0;
741 border-top: 1px solid var(--border, #e3e5ea);
742}
743
744#editor .ProseMirror hr.ProseMirror-selectednode {
745 outline: 2px solid var(--ring, #8a5a00);
746 outline-offset: 4px;
747 border-radius: 2px;
748}
749
750/* ---- Remote cursors and selections (loro-prosemirror classes) ---- */
751
752.ProseMirror-loro-cursor {
753 position: relative;
754 margin-left: -1px;
755 margin-right: -1px;
756 /* border-color is set inline per user */
757 border-left: 2px solid;
758 word-break: normal;
759 pointer-events: none;
760}
761
762/* Name label in the user's color, mono 11px. */
763.ProseMirror-loro-cursor > div {
764 position: absolute;
765 top: -1.5em;
766 left: -2px;
767 padding: 0 5px;
768 border-radius: 4px 4px 4px 0;
769 /* background-color is set inline per user */
770 color: #ffffff;
771 font-family: var(--font-mono, "Atkinson Hyperlegible Mono", ui-monospace, monospace);
772 font-size: 11px;
773 font-weight: 500;
774 line-height: 16px;
775 white-space: nowrap;
776 user-select: none;
777}
778
779.loro-selection {
780 border-radius: 2px;
781}
782
783@media (prefers-reduced-motion: reduce) {
784 .editor-toolbar-btn,
785 .bubble-btn,
786 .btn,
787 .tip,
788 #sync-status {
789 transition-duration: 0ms !important;
790 transition-delay: 0ms !important;
791 }
792}
793
794@media (forced-colors: active) {
795 .editor-toolbar-btn[aria-pressed="true"],
796 .bubble-btn[aria-pressed="true"],
797 .slash-item[aria-selected="true"] {
798 outline: 2px solid CanvasText;
799 }
800}