// Code block

Code block

A bordered code panel with an uppercase title bar, copy affordance, and a horizontally-scrolling body.

.talos-code is a framed code panel: a __bar carries the filename in the HUD display face, a __copy button sits at its right edge, and the __body is the monospaced <pre> below. The chrome is structural, not chromatic — the bar is the only thing that distinguishes it from a bare <pre>, so the panel reads as “this is a copyable artifact” before you read a single line.

Default

PREVIEW
button.astro
<Button variant=“ghost”>Engage</Button>
<div class="talos-code">
  <div class="talos-code__bar">
    <span>button.astro</span>
    <button class="talos-code__copy">copy</button>
  </div>
  <pre class="talos-code__body">&lt;Button variant="ghost"&gt;Engage&lt;/Button&gt;</pre>
</div>

__bar is uppercase display text on --talos-surface-2; __body is ui-monospace on --talos-surface-1 and scrolls horizontally on overflow rather than wrapping. The copy button is a static affordance — wire click to navigator.clipboard.writeText yourself.

Bar without copy

PREVIEW
nginx.conf
try_files $uri $uri/ =404;
<div class="talos-code">
  <div class="talos-code__bar"><span>nginx.conf</span></div>
  <pre class="talos-code__body">try_files $uri $uri/ =404;</pre>
</div>

The bar uses justify-content: space-between, so a lone label sits left and the copy button is purely optional. Drop __copy for read-only snippets.

Long line — horizontal scroll

PREVIEW
deploy.sh
ssh infrastructure.shelfwood.co “docker ps —format ’{{.Names}}’ | grep g53eqpbkjzqlilcfjx0jkw1z”
<pre class="talos-code__body">ssh host "docker ps --format '{{.Names}}' | grep …"</pre>

__body sets overflow-x: auto — long lines scroll within the panel instead of breaking the layout.

Inline code & kbd

The two inline siblings from the same CSS section. .talos-inline-code is a chip for code spans inside prose; .talos-kbd is a key cap with a 2px bottom edge.

PREVIEW

run bun run build then press R

<span class="talos-inline-code">bun run build</span>
<span class="talos-kbd">⌘</span><span class="talos-kbd">R</span>

Classes

ClassEffect
.talos-codebordered panel, rounded --talos-radius-sm, clips children
.talos-code__baruppercase display title bar on --talos-surface-2; space-between
.talos-code__copybordered copy button — hover brightens, :focus-visible shows the ring
.talos-code__bodymonospaced <pre> on --talos-surface-1; overflow-x: auto
.talos-inline-codeinline monospace chip for code spans in prose
.talos-kbdkey-cap chip — display face, 2px bottom border