Files
plan2code/src/web-console/public/notepad-editor.css
T

43 lines
2.5 KiB
CSS

/* The live-preview editor (notepad-editor.js, CodeMirror 6) lives in a shadow
root, because CodeMirror writes its own rules as a <style> element, which the
page's policy (`style-src 'self'`) refuses; inside a shadow root it adopts them as a
constructed stylesheet instead, which the policy allows. This file is that
shadow root's one stylesheet (a <link> to it, served from the allow-list),
so the page's own CSS does not reach in: the console's tokens do, since custom
properties inherit across the boundary, and one block covers both themes.
Classes only: inline styles are refused too. */
:host { display: block; height: 100%; }
.notepad-cm { height: 100%; }
.cm-editor { height: 100%; background: var(--panel); color: var(--ink); font-family: var(--sans); font-size: 15px; }
div.cm-editor.cm-focused { outline: none; }
div.cm-editor .cm-scroller { overflow: auto; line-height: 1.6; font-family: inherit; }
div.cm-editor .cm-content { padding: 16px; caret-color: var(--accent); }
div.cm-editor .cm-cursor { border-left-color: var(--accent); }
div.cm-editor .cm-selectionBackground,
div.cm-editor.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground { background: color-mix(in srgb, var(--accent) 25%, transparent) !important; }
/* Any rule below that pads a line (headings, quotes) is written `div.cm-editor`
too: at one class it would lose to this one. */
div.cm-editor .cm-line { padding: 0 2px; }
.cm-h1,
.cm-h2,
.cm-h3,
.cm-h4,
.cm-h5,
.cm-h6 { font-weight: 700; color: var(--accent); line-height: 1.3; }
div.cm-editor .cm-h1 { font-size: 1.8em; padding-top: 0.3em; }
div.cm-editor .cm-h2 { font-size: 1.45em; padding-top: 0.25em; }
.cm-h3 { font-size: 1.2em; }
.cm-h4 { font-size: 1.05em; }
.cm-h5,
.cm-h6 { font-size: 1em; color: var(--ink-2); }
.cm-strong { font-weight: 700; }
.cm-em { font-style: italic; }
.cm-strike { text-decoration: line-through; color: var(--ink-3); }
.cm-link { color: var(--accent); text-decoration: underline; }
.cm-code { font-family: var(--mono); font-size: 0.92em; background: color-mix(in srgb, var(--rule) 70%, transparent); border-radius: 4px; padding: 0 3px; }
.cm-codeblock { font-family: var(--mono); font-size: 0.92em; background: color-mix(in srgb, var(--rule) 55%, transparent); }
.cm-fence { color: var(--ink-3); }
div.cm-editor .cm-quote { color: var(--ink-2); border-left: 3px solid var(--accent-line); padding-left: 10px; }
.cm-hr { color: var(--ink-3); border-bottom: 1px solid var(--rule-2); }
.cm-bullet { color: var(--accent); font-weight: 700; display: inline-block; width: 1em; text-align: center; }