quiltlang 0.6.0

Quilt, a polyglot metaprogramming language: source code with arrow-bracket syntax for embedding and manipulating code fragments of other languages at code-generation time.
Documentation
/* The editor's chrome. The *cells* are styled by the page itself (the
   notebook's own stylesheet, which the page can take over); this file is
   only the frame around it — so the two never fight over a selector. */

:root {
  color-scheme: light dark;
  --accent: #8250df;
  --line: #d0d7de;
  --ink: #1f2328;
  --mute: #57606a;
  --paper: #fff;
  --panel: #f6f8fa;
  --bad: #cf222e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --line: #3d444d;
    --ink: #e6edf3;
    --mute: #9198a1;
    --paper: #0d1117;
    --panel: #161b22;
    --bad: #ff7b72;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font:
    14px/1.45 system-ui,
    -apple-system,
    sans-serif;
}

.bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.bar h1 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.grow {
  flex: 1;
}

button,
select,
.bar a {
  font: inherit;
  color: inherit;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.bar a:hover {
  border-color: var(--accent);
}

button.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--mute);
}

button.quiet:hover {
  color: var(--ink);
  border-color: var(--line);
}

button[disabled] {
  opacity: 0.5;
  cursor: default;
}

.chip {
  font: 600 0.7rem/1.6 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 0.5rem;
}

.chip.live {
  color: #1a7f37;
  border-color: #1a7f37;
}

.chip.lost {
  color: var(--bad);
  border-color: var(--bad);
}

.hint {
  color: var(--mute);
  font-size: 0.8rem;
}

main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(22rem, 40%) 1fr;
  min-height: 0;
}

#editor {
  overflow: auto;
  padding: 0.75rem;
  border-right: 1px solid var(--line);
}

#view {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.tabs button.on {
  border-color: var(--accent);
  color: var(--accent);
}

iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--paper);
}

/* ── one cell ─────────────────────────────────────────────────────────── */

.cell {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  margin-bottom: 0.75rem;
  background: var(--panel);
  overflow: hidden;
}

.cell.running {
  border-left-style: dotted;
}

.cell.failed {
  border-left-color: var(--bad);
}

.cell.pending {
  border-left-color: #8c959f;
}

.cell.generated {
  border-left-style: dashed;
}

.head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid var(--line);
}

.head .id {
  font: 600 0.75rem/1 var(--mono);
  color: var(--mute);
  padding-left: 0.25rem;
}

.head .lang {
  padding: 0.1rem 0.3rem;
}

.badges {
  display: flex;
  gap: 0.25rem;
}

.badge {
  font: 0.7rem/1.5 var(--mono);
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 0.3rem;
}

textarea.src {
  display: block;
  width: 100%;
  border: 0;
  resize: vertical;
  padding: 0.5rem 0.6rem;
  background: var(--paper);
  color: var(--ink);
  font: 0.85rem/1.5 var(--mono);
  tab-size: 2;
}

textarea.src:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.program,
.out {
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-top: 1px dashed var(--line);
  font: 0.8rem/1.45 var(--mono);
  white-space: pre-wrap;
  overflow-x: auto;
}

.out .value {
  color: #0550ae;
}

.out .err {
  color: var(--bad);
}

.out .warn {
  color: #9a6700;
}

.out p {
  margin: 0 0 0.25rem;
}

@media (prefers-color-scheme: dark) {
  .out .value {
    color: #79c0ff;
  }
}

.add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.25rem 0 1rem;
}

@media (max-width: 52rem) {
  main {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  #editor {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}