Skip to content

Commit 6e30932

Browse files
committed
style: Make rendered markdown match display styling instead of input styling.
1 parent c7c4527 commit 6e30932

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

packages/design-system/src/css/style.css

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -509,36 +509,40 @@ body {
509509
.comfy-markdown {
510510
/* We assign the textarea and the Tiptap editor to the same CSS grid area to stack them on top of one another. */
511511
display: grid;
512-
}
512+
& > textarea,
513+
.tiptap {
514+
grid-area: 1 / 1 / 2 / 2;
515+
}
513516

514-
.comfy-markdown > textarea {
515-
grid-area: 1 / 1 / 2 / 2;
516-
}
517+
& > textarea {
518+
opacity: 0;
519+
pointer-events: none;
520+
}
517521

518-
.comfy-markdown .tiptap {
519-
grid-area: 1 / 1 / 2 / 2;
520-
background-color: var(--comfy-input-bg);
521-
color: var(--input-text);
522-
overflow: hidden;
523-
overflow-y: auto;
524-
resize: none;
525-
border: none;
526-
box-sizing: border-box;
527-
font-size: var(--comfy-textarea-font-size);
528-
height: 100%;
529-
padding: 0.5em;
530-
}
522+
&.editing {
523+
& > textarea {
524+
opacity: 1;
525+
pointer-events: all;
526+
}
531527

532-
.comfy-markdown.editing .tiptap {
533-
display: none;
534-
}
528+
.tiptap {
529+
opacity: 0;
530+
pointer-events: none;
531+
}
532+
}
535533

536-
.comfy-markdown .tiptap :first-child {
537-
margin-top: 0;
538-
}
534+
.tiptap {
535+
overflow-y: auto;
536+
font-size: var(--comfy-textarea-font-size);
539537

540-
.comfy-markdown .tiptap :last-child {
541-
margin-bottom: 0;
538+
:first-child {
539+
margin-top: 0;
540+
}
541+
542+
:last-child {
543+
margin-bottom: 0;
544+
}
545+
}
542546
}
543547

544548
.comfy-markdown .tiptap blockquote {

0 commit comments

Comments
 (0)