Files
client/app/renderer/styles/chat-editor.css
T
omar f618d8bce9
ci / linux-arm64-cross (push) Successful in 3m22s
ci / linux-x64 (push) Successful in 3m32s
chat: add safe hybrid Markdown editing with strict CSP
2026-11-02 11:32:31 +03:00

35 lines
1.9 KiB
CSS

/* Chat composer editor: one CodeMirror view in #chat-editor (chat-editor.js), contentDOM #chat-input.
Source: TSChatInputTextarea `.ts-chat-input` (main.css@212291), its inner editor (@205434) and the
CodeMirror overrides scoped to it (@205985-206823). The engine's JS theme only neutralises CodeMirror
defaults; every visible value here is the source's. */
.composer-editor {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
min-height: 34px;
max-height: 250px;
padding: var(--tsv-padding-v) var(--tsv-padding-h-small);
border: none;
background-color: transparent;
color: var(--tsv-font-color);
font-size: var(--tsv-font-size-content);
font-weight: 400;
line-height: var(--tsv-line-height-content);
/* source -.025rem resolves against the source's fixed 15px root (main.css@1034 `body,html{font-size:15px}`) */
letter-spacing: -0.375px;
outline: none;
}
#chat-editor .cm-editor { flex-shrink: 1; min-height: 0; background: transparent; color: var(--tsv-font-color); outline: none; }
#chat-editor .cm-editor.cm-focused { outline: none; }
#chat-editor .cm-scroller { font-family: inherit; line-height: inherit; overflow: auto; }
#chat-editor .cm-content { padding: 0; white-space: pre-wrap; caret-color: var(--tsv-font-color); }
#chat-editor .cm-content:focus-visible { outline: none; }
/* `.is-empty:before{content:attr(data-placeholder)}` (main.css@205743): subtitle colour, content size */
#chat-editor .cm-placeholder { color: var(--tsv-font-subtitle-color); font-size: var(--tsv-font-size-content); pointer-events: none; }
#chat-editor .tp-chat-editor-disabled .cm-content { cursor: default; }
/* Raw `[id]: url` definitions stay editable source; they are not message content. */
#chat-editor .cm-line.tp-chat-editor-definition { color: var(--tsv-font-subtitle-color); }
/* Rendered inactive blocks reuse the message markdown rules (.ts-parsed-text-content) without extra spacing. */
#chat-editor .tp-chat-editor-block { margin: 0; }