lumbda/wasm/app/style.css
russell@unturf.com 7e32eefd6b
playground+repl: bend dispatch from WASM + 1.33 zoom + free-form runner
bend!-call from the WAT tier
  - New WAT import: (import "env" "bend_call"). The host loader supplies
    a sync XMLHttpRequest that POSTs the payload to a configured URL
    (workers only — sync XHR isn't allowed on main thread).
  - New primitive (bend!-call "<payload>") returns the response as a
    lumbda string. Works in playground and REPL once the bend URL is
    saved in the new top bar.
  - bendUrl persists in plain localStorage (not encrypted — it's a
    server address, not a secret).
  - Tests stub the import with a no-op so unit / integration / functional
    suites keep instantiating cleanly.

Playground + REPL zoom 133% by default
  - html { zoom: 1.33 } so the styleguide sizes read comfortably without
    requiring browser-level zoom.

Free-form default = cross-tier assertion runner in Lisp
  - The default editor content for "free form" is now a small assertion
    framework matching tests/functional.lsp's PASS/FAIL convention. A
    starter the user can extend, runs identically on the three tiers.

C tier + Python tier (bend) are wired through the runner stub; full
bend integration in those tiers comes next once their loaders learn
about setBendUrl.
2026-06-14 13:05:06 -04:00

358 lines
8.3 KiB
CSS

/* lumbda playground — styled to match lumbda.com homepage.
* palette + typography mirror www/style.css.
*/
@font-face {
font-family: 'chunkfive';
src: url('fonts/chunkfive/chunkfive-regular-webfont.woff2') format('woff2'),
url('fonts/chunkfive/chunkfive-regular-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
}
:root {
--fg: #1a1a1a;
--bg: #fafaf7;
--muted: #666;
--accent: #227842; /* single brand green — matches homepage */
--green: #227842;
--rule: #d4d4d0;
--code-bg: #f0ede4;
--pane-bg: #ffffff;
--busy: #b15a00;
--err: #b1262b;
--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}
@media (prefers-color-scheme: dark) {
:root {
--fg: #e8e6e0;
--bg: #161613;
--muted: #9a9892;
--accent: #5ec07a; /* lightened for contrast on dark bg */
--green: #5ec07a;
--rule: #3a3a36;
--code-bg: #22221f;
--pane-bg: #1c1c19;
--busy: #e0a050;
--err: #f06070;
}
}
* { box-sizing: border-box; }
html {
/* Default zoom so text is comfortably readable. Native CSS zoom
* preserves layout proportions across the whole document. */
zoom: 1.33;
}
html, body {
margin: 0; padding: 0;
background: var(--bg);
color: var(--fg);
font-family: var(--mono);
font-size: 14px;
line-height: 1.55;
}
/* ─── Header ────────────────────────────────────────────────────── */
header {
border-bottom: 1px solid var(--rule);
padding: 1.5rem 1.5rem 1rem;
}
.brand {
display: inline-flex;
align-items: flex-end;
gap: 0.6rem;
text-decoration: none;
color: inherit;
}
.brand:hover .period { transform: translateY(-2px); }
.brand .logo {
width: 3.2rem;
height: auto;
display: block;
}
header h1 {
font-family: 'chunkfive', Georgia, serif;
font-size: 2.4rem;
margin: 0;
letter-spacing: -0.01em;
line-height: 1;
font-weight: normal;
}
header h1 .period {
color: var(--green);
display: inline-block;
transition: transform 120ms ease;
}
header .tagline {
font-family: 'chunkfive', Georgia, serif;
color: var(--muted);
margin: 0.4rem 0 0.6rem;
font-size: 1rem;
letter-spacing: 0.01em;
}
header .lede {
margin: 0;
max-width: 70rem;
color: var(--fg);
font-size: 0.85rem;
line-height: 1.55;
}
header .lede strong {
color: var(--green);
font-weight: 600;
}
header code {
background: var(--code-bg);
padding: 0 0.2em;
border-radius: 2px;
font-size: 0.9em;
}
/* ─── Controls ──────────────────────────────────────────────────── */
.controls {
padding: 0.75rem 1.5rem;
border-bottom: 1px solid var(--rule);
display: flex;
gap: 1rem;
align-items: center;
flex-wrap: wrap;
background: var(--bg);
}
.controls fieldset {
border: 1px solid var(--rule);
border-radius: 3px;
padding: 3px 10px 5px;
margin: 0;
background: var(--pane-bg);
}
.controls fieldset legend {
color: var(--muted);
font-size: 0.7rem;
padding: 0 0.4em;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.controls label {
margin-right: 0.7em;
cursor: pointer;
user-select: none;
font-size: 0.85em;
}
.controls label input {
margin-right: 0.3em;
accent-color: var(--green);
}
.controls button {
font-family: var(--mono);
font-size: 0.85em;
font-weight: 600;
padding: 6px 16px;
border-radius: 3px;
cursor: pointer;
border: 1px solid var(--green);
}
.controls button.primary {
background: var(--green);
color: var(--bg);
}
.controls button.primary:hover { filter: brightness(1.08); }
.controls button.primary:disabled {
opacity: 0.4; cursor: wait;
filter: none;
}
.controls button.secondary {
background: transparent;
color: var(--green);
}
.controls button.secondary:hover {
background: var(--code-bg);
}
.controls button.secondary:disabled {
opacity: 0.35; cursor: default;
}
.controls .status {
color: var(--muted);
font-size: 0.8em;
margin-left: auto;
}
.controls .status.busy { color: var(--busy); }
.controls .status.warn { color: var(--busy); }
.controls .status.err { color: var(--err); }
.controls .status.ok { color: var(--green); }
.bend-bar {
padding: 0.4rem 1.5rem;
border-bottom: 1px solid var(--rule);
display: flex; align-items: center; gap: 0.6rem;
background: var(--bg);
font-size: 0.85em;
}
.bend-bar .bend-icon { font-size: 1em; }
.bend-bar label {
flex: 1;
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--muted);
}
.bend-bar input[type=url] {
flex: 1;
background: var(--code-bg);
border: 1px solid var(--rule);
color: var(--fg);
padding: 0.3rem 0.5rem;
font-family: var(--mono);
font-size: 0.9em;
border-radius: 3px;
}
.bend-bar input[type=url]:focus { outline: none; border-color: var(--green); }
.bend-bar button {
background: transparent;
color: var(--green);
border: 1px solid var(--green);
font-family: var(--mono);
font-size: 0.85em;
font-weight: 600;
padding: 0.3rem 0.8rem;
border-radius: 3px;
cursor: pointer;
}
.bend-bar button:hover { background: var(--code-bg); }
.bend-bar .bend-state { color: var(--green); font-size: 0.8em; min-width: 4em; }
.vault-bar {
padding: 0.5rem 1.5rem;
border-bottom: 1px solid var(--rule);
display: flex; align-items: center; gap: 0.6rem;
background: var(--bg);
font-size: 0.85em;
}
.vault-bar .vault-icon { font-size: 1em; }
.vault-bar .vault-state { color: var(--muted); }
.vault-bar .vault-state.unlocked { color: var(--green); }
.vault-bar input[type=password] {
background: var(--code-bg);
border: 1px solid var(--rule);
color: var(--fg);
padding: 0.3rem 0.5rem;
font-family: var(--mono);
font-size: 0.9em;
border-radius: 3px;
width: 18rem;
}
.vault-bar input[type=password]:focus { outline: none; border-color: var(--green); }
.vault-bar button {
background: transparent;
color: var(--green);
border: 1px solid var(--green);
font-family: var(--mono);
font-size: 0.85em;
font-weight: 600;
padding: 0.3rem 0.8rem;
border-radius: 3px;
cursor: pointer;
}
.vault-bar button:hover { background: var(--code-bg); }
.vault-bar .vault-note { color: var(--muted); font-size: 0.85em; }
.vault-bar .vault-note.err { color: var(--err); }
/* ─── Panes ─────────────────────────────────────────────────────── */
.panes {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1px;
background: var(--rule);
align-items: start;
}
.pane {
background: var(--pane-bg);
padding: 0.5rem 0.75rem 0.75rem;
display: flex;
flex-direction: column;
}
.pane h2 {
margin: 0 0 0.4rem;
font-size: 0.7rem;
font-weight: 500;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.1em;
}
#editor {
border-radius: 2px;
}
.cm-editor { font-size: 13px; }
.cm-editor.cm-focused { outline: none; }
.cm-scroller { overflow: visible; }
#output {
white-space: pre;
background: var(--code-bg);
border-radius: 2px;
padding: 0.6rem 0.8rem;
font-size: 13px;
line-height: 1.35;
}
/* Append-only: results arrive in finish order — fastest tier shows up first. */
#output .tier-block { margin-bottom: 1rem; }
#output .tier-block:last-child { margin-bottom: 0; }
#output .tier-block h3 {
margin: 0 0 0.25rem;
font-size: 0.7rem;
color: var(--green);
text-transform: uppercase;
letter-spacing: 0.1em;
font-weight: 600;
}
#output .tier-block .time {
color: var(--muted);
font-size: 0.65rem;
font-weight: 400;
letter-spacing: 0;
text-transform: none;
}
#output .tier-block pre {
margin: 0;
white-space: pre;
font-family: var(--mono);
}
#output .err {
color: var(--err);
}
/* ─── Footer ────────────────────────────────────────────────────── */
footer {
padding: 0.7rem 1.5rem;
border-top: 1px solid var(--rule);
color: var(--muted);
font-size: 0.75rem;
}
footer code {
background: var(--code-bg);
padding: 0 0.2em;
border-radius: 2px;
}
footer a {
color: var(--green);
text-decoration: none;
}
footer a:hover { text-decoration: underline; }
footer strong { color: var(--fg); }