Files
llama.cpp/ui/apps/chat/tests/stories/introduction/Stack.svelte
T
Aleksander Grygier b81aa847c2 ui: slim the design tokens and set all text through type roles (#32615)
* ui: drop component tokens that only alias a semantic token

A component token now exists only for what a component decides itself:
a value no semantic token has, or one that only this component changes
between themes. Components that take a semantic token as it is read it
directly, so 88 of the 118 component tokens go, with no change to what
is drawn.

Also drops semantic tokens that repeat another one (status-* is fill-*,
elevation-tooltip is elevation-surface), the unused info lamp tokens and
14 primitives nothing reads, and adds fg-soft for the label of an option
that is not the picked one (tabs, toggle group).

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add a short summary on top of DESIGN.md

The rules most changes need, in one screen: components, colour, type,
shape, sizes, surfaces, tokens and no arbitrary values. The sections
below keep the detail.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: derive design tokens by rule and drop the alias layers

Semantic tokens are either a pick (a primitive per theme) or a derivation,
mixed from another semantic token by a fixed rule and declared once: hover
fills, status surfaces and lines, dark shadows (--elevation-strength), the
middle of a matte edge, a lamp's rim and glyph.

Primitives keep colours only. shadcn's colour names stay as Tailwind
utilities and no longer exist as variables; neutral semantic utilities that
duplicated them are gone.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: set all text through type roles and move off-scale values onto the scale

Tailwind's text sizes and bracketed sizes become the type roles, with a new
text-caption-sm (10px) for tags and counts. Body and caption roles no longer
set a weight, and line heights are written as Tailwind writes its own, so the
swap from text-sm and text-xs changes no pixel. A unit test keeps old sizes
from coming back.

Arbitrary values with a scale equivalent use it (z-20, max-w-4/5, min-w-32),
and the two easing curves repeated across the app are ease-out-quint and
ease-sheet. DESIGN.md is updated and regenerated.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: bump @ggml-org/llama-ui to 0.5.0

Removed and renamed tokens are breaking for an app that reads them.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: add a display type role for the biggest headline

The greeting on a new chat keeps its 30px from md up, now as text-display
instead of a Tailwind size.

Assisted-by: Claude (Opus 5.5 Medium)

* ui: one corner scale, one set of shadows and three more derived tokens

Six corner roles named values Tailwind's rounded-md to rounded-4xl
already have, and components used the Tailwind names nine times out of
ten. The roles are gone; the whole scale is computed from --radius.

Tailwind's shadow sizes were restated next to the elevation tokens and
did not follow the theme, so they were five times fainter in dark. The
five uses take elevation tokens and a unit test keeps both from coming
back.

A button group's seam is the button's own text colour at 25%, the dark
status text is the dark status fill, and the pressed shadow scales with
--elevation-strength like the inset one.

Assisted-by: Claude (Opus 5.5 Medium)
2026-11-20 11:26:26 +01:00

130 lines
2.6 KiB
Svelte

<!--
What this Storybook holds, as building blocks: the Llama Brand at the base, Llama UI built on it, Llama Chat built
from Llama UI, and the communications made from the brand and the app beside them. Llama Chat, the one people use,
carries the cinder mark; the brand carries the icon, typed as Llama Sans's lockup glyph. Beside Llama Chat, a
dashed, dimmed slot for the other apps anyone can build on Llama UI.
-->
<div class="stack">
<div class="block chat card-surface rounded-xl">
<span class="n">03</span>
<h3>Llama Chat</h3>
<p>The app, built from Llama UI</p>
</div>
<div class="block apps rounded-xl">
<h3>Other apps</h3>
<p>Yours, built on Llama UI</p>
</div>
<div class="block comms card-surface rounded-xl">
<h3>Communications</h3>
<p>Posts, store screenshots, link previews and swag, made from the brand and the app</p>
</div>
<div class="block ui card-surface rounded-xl">
<span class="n">02</span>
<h3>Llama UI</h3>
<p>The components and their tokens</p>
</div>
<div class="block brand card-surface rounded-xl">
<span class="n">01</span>
<!-- the lockup glyph, U+E002: Llama Sans's capital icon with the gap before the name built in -->
<h3>&#xE002;Llama Brand</h3>
<p>The icon, Llama Sans and Llama Mono, the colours</p>
</div>
</div>
<style>
.stack {
display: grid;
grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 2fr);
grid-template-areas:
'chat apps comms'
'ui ui comms'
'brand brand brand';
gap: 8px;
}
.block {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
gap: 4px 12px;
align-content: center;
align-items: baseline;
padding: 16px 20px;
}
.chat {
grid-area: chat;
}
.ui {
grid-area: ui;
}
/* not one of ours: a slot, dashed and dimmed, for whatever someone builds next */
.apps {
grid-area: apps;
grid-template-columns: minmax(0, 1fr);
border: 1.5px dashed color-mix(in oklab, var(--fg-muted) 55%, transparent);
opacity: 0.7;
}
.apps p {
grid-column: 1;
}
.brand {
grid-area: brand;
}
.comms {
grid-area: comms;
grid-template-columns: minmax(0, 1fr);
}
.n {
color: var(--figure-muted);
font: 500 12px var(--mono);
}
/* the one accent: the app people use */
.chat .n {
color: var(--art-cinder);
}
h3 {
margin: 0;
font-size: 18px;
font-weight: 600;
}
p {
grid-column: 2;
margin: 0;
color: var(--figure-muted);
font-size: 15px;
line-height: 1.45;
}
.comms p {
grid-column: 1;
}
@media (max-width: 640px) {
.stack {
grid-template-columns: minmax(0, 1fr);
grid-template-areas: 'chat' 'apps' 'ui' 'brand' 'comms';
}
}
</style>