:root { --bg: #f7f7f5; --panel: #ffffff; --text: #1c1f1e; --muted: #5f6662; --line: #dfe2df; --accent: #2f6f5e; --error-bg: #fdecea; --error-text: #8a1c12; --busy: #8a6100; /* Text on the accent: 5.8:1 here, 7.9:1 in dark. */ --on-accent: #ffffff; --control-line: #9aa09c; /* A step that can't be undone: 6.5:1 here, 9:1 in dark. */ --danger: #b3261e; --on-danger: #ffffff; color-scheme: light; } /* Dark: the system's, unless the theme button chose light; or chosen (data-theme, main.ts). */ @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #161917; --panel: #1e2220; --text: #e8ebe9; --muted: #a3aba6; --line: #333936; --accent: #6fbfa6; --error-bg: #3a1d1a; --error-text: #ffb4a8; --busy: #e0b04a; --on-accent: #0d1f19; --control-line: #5b635f; --danger: #ffb4a8; --on-danger: #3a0d08; color-scheme: dark; } } :root[data-theme="dark"] { --bg: #161917; --panel: #1e2220; --text: #e8ebe9; --muted: #a3aba6; --line: #333936; --accent: #6fbfa6; --error-bg: #3a1d1a; --error-text: #ffb4a8; --busy: #e0b04a; --on-accent: #0d1f19; --control-line: #5b635f; --danger: #ffb4a8; --on-danger: #3a0d08; color-scheme: dark; } * { box-sizing: border-box; } html, body { margin: 0; height: 100%; } body { background: var(--bg); color: var(--text); font: 14px / 1.4 system-ui, -apple-system, "Segoe UI", sans-serif; display: flex; flex-direction: column; } .bar { display: flex; align-items: center; gap: 16px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); } .brand { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; } .brand span { color: var(--accent); } /* easycms.dev's logo (public/favicon.svg), in the page's accent so it follows the theme. */ .brand .logo { width: 22px; height: 22px; flex: none; } .brand .logo rect { fill: var(--accent); } .brand .logo path { stroke: var(--on-accent); stroke-width: 3; stroke-linecap: round; } .spacer { flex: 1; } .status { color: var(--muted); font-size: 13px; white-space: nowrap; } .status[data-state="busy"] { color: var(--busy); } .status[data-state="error"] { color: var(--error-text); } .bar a, .bar button { color: var(--text); background: none; border: 1px solid var(--control-line); border-radius: 6px; padding: 4px 10px; font: inherit; text-decoration: none; white-space: nowrap; cursor: pointer; } .bar button.primary, dialog button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); max-width: min(640px, calc(100vw - 32px)); padding: 20px 24px; } dialog::backdrop { background: rgb(0 0 0 / 0.35); } dialog h2 { margin: 0 0 8px; font-size: 18px; } dialog pre { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; max-height: 160px; overflow: auto; font: 12px / 1.5 ui-monospace, SFMono-Regular, Menlo, monospace; } dialog .actions { display: flex; gap: 8px; flex-wrap: wrap; } dialog button { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; background: none; color: var(--text); cursor: pointer; } dialog .hint { color: var(--muted); font-size: 13px; margin-bottom: 0; } .panes { flex: 1; display: grid; /* The code's width is the divider's (main.ts sets --code-width), else two fifths. */ grid-template-columns: var(--code-width, minmax(360px, 2fr)) auto 3fr; min-height: 0; } /* Dragging: the selection would follow the pointer. */ .panes[data-resizing] { cursor: col-resize; user-select: none; } .divider { width: 7px; margin: 0 -3px; z-index: 1; cursor: col-resize; background: linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat; touch-action: none; } .divider:hover, .divider:focus-visible, .panes[data-resizing] .divider { background-image: linear-gradient(var(--accent), var(--accent)); background-size: 3px 100%; outline: none; } /* Full screen: the admin across the window, under the bar. The frame stays where it is: moving it would load the sandbox again, and its in-memory documents would go. */ .panes[data-full-screen] { grid-template-columns: 1fr; } .panes[data-full-screen] .code, .panes[data-full-screen] .divider { display: none; } .code { display: flex; flex-direction: column; min-width: 0; background: var(--panel); } .file { padding: 6px 16px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); } .editor { flex: 1; min-height: 0; } .error { padding: 8px 16px; background: var(--error-bg); color: var(--error-text); font: 12px / 1.4 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; max-height: 30%; overflow: auto; } .console { border-top: 1px solid var(--line); font-size: 12px; position: relative; } .console summary { padding: 6px 16px; cursor: pointer; color: var(--muted); } .console summary span { margin-left: 4px; } .console button { position: absolute; right: 12px; top: 3px; font: inherit; background: none; color: var(--muted); border: 0; cursor: pointer; } .console ol { margin: 0; padding: 0 16px 8px; list-style: none; max-height: 160px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; } .console li[data-level="warn"] { color: var(--busy); } .console li[data-level="error"] { color: var(--error-text); } .preview { position: relative; min-width: 0; } .preview iframe { border: 0; width: 100%; height: 100%; display: block; background: var(--panel); } .phone-note { display: none; } /* Narrow screens: the bar's buttons need the room; the status keeps its dot (its words stay for screen readers, and errors still show under the code). */ @media (max-width: 1279px) { .problems-words { display: none; } } @media (max-width: 1023px) { .bar { gap: 10px; } .status { font-size: 0; } } /* Tablets: tighter, and the Docs link goes (easycms.dev has them). */ @media (max-width: 899px) { .bar { gap: 6px; padding: 8px 12px; } .bar a { display: none; } } /* Phones: the admin only; editing wants a keyboard and room. */ @media (max-width: 767px) { /* Phones: no editing, so no code buttons; templates and the theme stay, at a size for thumbs. The status keeps its dot (its words stay for screen readers); Docs goes for room. */ .bar { padding: 8px 16px; gap: 8px; } .bar button:not(#theme, #templates-open), .bar a { display: none; } .bar button { min-height: 40px; min-width: 40px; } .status { font-size: 0; } .panes { grid-template-columns: 1fr; } .code, .divider { display: none; } .phone-note { display: block; margin: 0; padding: 8px 16px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); } .preview { display: flex; flex-direction: column; } .preview iframe { flex: 1; } } /* Templates: a grid of cards, the one in use marked. */ .bar button svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; } dialog.templates { max-width: min(880px, calc(100vw - 32px)); width: 100%; } .templates header { display: flex; align-items: center; justify-content: space-between; gap: 16px; } .templates header h2 { margin: 0; } .templates .close { border: 0; padding: 6px; line-height: 0; color: var(--muted); } .templates .close svg { width: 18px; height: 18px; } .templates .hint { margin: 4px 0 16px; } .template-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; max-height: min(70vh, 640px); overflow: auto; } .template-list button { width: 100%; height: 100%; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: start; text-align: left; padding: 12px; border-radius: 8px; transition: border-color 0.15s, background-color 0.15s; } .template-list button:hover { border-color: var(--accent); } .template-list button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; } .template-list button[aria-current="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); } .template-list .icon { grid-row: span 3; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); } .template-list .icon svg { width: 20px; height: 20px; } .template-list .name { font-weight: 600; display: flex; gap: 8px; align-items: baseline; } .template-list .current { font-size: 11px; font-weight: 500; color: var(--accent); } .template-list .description { color: var(--muted); font-size: 13px; } .template-list .features { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; } .template-list .features span { font-size: 11px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); } @media (prefers-reduced-motion: reduce) { .template-list button { transition: none; } } /* The first visit's tip, above the code. */ .hint-bar { display: flex; align-items: flex-start; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 10%, var(--panel)); font-size: 13px; } .hint-bar[hidden] { display: none; } .hint-bar p { margin: 0; flex: 1; padding-top: 3px; } .hint-bar b { font-weight: 600; } .hint-bar button { border: 0; background: none; color: var(--muted); padding: 4px; line-height: 0; border-radius: 6px; cursor: pointer; } .hint-bar button:hover { color: var(--text); } #hint-close svg { width: 16px; height: 16px; } /* The status line: a dot with the state's colour (the words say it too), and type problems. */ .status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--accent); vertical-align: 1px; } .status[data-state="busy"]::before { background: var(--busy); } .status[data-state="error"]::before { background: var(--error-text); } .bar .problems { color: var(--busy); border-color: transparent; padding: 4px 6px; } .bar .problems:hover { border-color: var(--control-line); } .bar #theme { padding: 4px 6px; line-height: 0; } .bar #theme svg { margin: 0; } /* While the divider is dragged, the frames don't take the pointer. */ .panes[data-resizing] iframe { pointer-events: none; } /* Studio's own question (ask in main.ts): what will go, and a way to keep it first. */ dialog.ask { max-width: min(480px, calc(100vw - 32px)); } dialog.ask p { margin: 0 0 16px; color: var(--muted); } dialog button.danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); } .bar #reset-data { padding: 4px 6px; line-height: 0; } .bar #reset-data svg { margin: 0; }