styling
The utility families and the state, window and scheme prefixes, one page each.
Run it
cargo run -p duolith-cli -- dev examples/styling # live, reloads on save
cargo run -p duolith-cli -- build examples/styling # static output in examples/styling/dist
The folder on the web: examples/styling.
Features it shows
| Feature | Where | Screenshot |
|---|---|---|
| Layout utilities (row, grow, items, justify, gap, grid) | gallery pages/styling.duo (Layout); styling pages/layout.duo | gallery-styling.png, styling-layout.png |
| Spacing utilities | styling pages/spacing.duo; gallery pages/styling.duo | styling-spacing.png |
| Colour utilities | gallery pages/styling.duo (Colour); styling pages/color.duo | gallery-styling-colour.png, styling-color.png |
| Borders and radius | styling pages/borders.duo; gallery pages/styling.duo | styling-borders.png |
pressed:, hover:, focus:, disabled: | gallery pages/styling.duo (State prefixes); styling pages/states.duo | gallery-styling-prefixes.png, styling-states.png |
Source
pages/borders.duo
<screen title="Borders, shadows and radius" class="p-4 gap-6 bg-canvas">
<view class="row items-center justify-between">
<text class="text-title text-ink">Borders</text>
<text class="text-label text-primary" href="/">All utilities</text>
</view>
<view class="gap-2">
<text class="text-caption text-muted">border · border-2 · border-4 · border-8 · border-0</text>
<view class="row gap-2">
<view class="w-14 h-14 rounded-md bg-surface border" />
<view class="w-14 h-14 rounded-md bg-surface border-2" />
<view class="w-14 h-14 rounded-md bg-surface border-4" />
<view class="w-14 h-14 rounded-md bg-surface border-8" />
<view class="w-14 h-14 rounded-md bg-surface border-0" />
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
border-2 with border-primary · border-danger · border-success · border-ink
</text>
<view class="row gap-2">
<view class="w-14 h-14 rounded-md bg-surface border-2 border-primary" />
<view class="w-14 h-14 rounded-md bg-surface border-2 border-danger" />
<view class="w-14 h-14 rounded-md bg-surface border-2 border-success" />
<view class="w-14 h-14 rounded-md bg-surface border-2 border-ink" />
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">border-t · border-b (a list)</text>
<view class="rounded-md bg-surface border">
<text class="p-3 text-body text-ink">First row</text>
<text class="p-3 border-t text-body text-ink">border-t</text>
<text class="p-3 border-t border-b text-body text-ink">border-t border-b</text>
<text class="p-3 text-body text-ink">Last row</text>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">rounded-none · xs · sm · md · lg · xl · 2xl · full</text>
<view class="row wrap gap-2">
<view class="w-14 h-14 rounded-none bg-primary" />
<view class="w-14 h-14 rounded-xs bg-primary" />
<view class="w-14 h-14 rounded-sm bg-primary" />
<view class="w-14 h-14 rounded-md bg-primary" />
<view class="w-14 h-14 rounded-lg bg-primary" />
<view class="w-14 h-14 rounded-xl bg-primary" />
<view class="w-14 h-14 rounded-2xl bg-primary" />
<view class="w-14 h-14 rounded-full bg-primary" />
</view>
<view class="row gap-2">
<text class="px-4 py-1 rounded-full bg-raised text-label text-ink">rounded-full pill</text>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
shadow-none · shadow-sm · shadow-md · shadow-lg (stronger in dark mode)
</text>
<view class="row gap-4 p-4">
<view class="grow h-16 rounded-lg bg-surface shadow-none border" />
<view class="grow h-16 rounded-lg bg-surface shadow-sm" />
<view class="grow h-16 rounded-lg bg-surface shadow-md" />
<view class="grow h-16 rounded-lg bg-surface shadow-lg" />
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
all together: overflow-hidden rounded-xl shadow-md border
</text>
<view class="overflow-hidden rounded-xl bg-surface shadow-md border">
<view class="w-full aspect-video bg-primary" />
<view class="gap-1 p-4">
<text class="text-heading text-ink">A card</text>
<text class="text-body text-muted">
overflow-hidden clips the picture to the rounded corners.
</text>
</view>
</view>
</view>
</screen>pages/color.duo
<screen title="Colour and type" class="p-4 gap-6 bg-canvas">
<view class="row items-center justify-between">
<text class="text-title text-ink">Colour and type</text>
<text class="text-label text-primary" href="/">All utilities</text>
</view>
<view class="gap-2">
<text class="text-caption text-muted">bg-* for every colour token</text>
<view class="row wrap gap-2">
<view class="w-20 gap-1">
<view class="h-12 rounded-md bg-canvas border" />
<text class="text-caption text-muted">canvas</text>
</view>
<view class="w-20 gap-1">
<view class="h-12 rounded-md bg-surface border" />
<text class="text-caption text-muted">surface</text>
</view>
<view class="w-20 gap-1">
<view class="h-12 rounded-md bg-raised" />
<text class="text-caption text-muted">raised</text>
</view>
<view class="w-20 gap-1">
<view class="h-12 rounded-md bg-border" />
<text class="text-caption text-muted">border</text>
</view>
<view class="w-20 gap-1">
<view class="h-12 rounded-md bg-primary" />
<text class="text-caption text-muted">primary</text>
</view>
<view class="w-20 gap-1">
<view class="h-12 rounded-md bg-on-primary border" />
<text class="text-caption text-muted">on-primary</text>
</view>
<view class="w-20 gap-1">
<view class="h-12 rounded-md bg-ink" />
<text class="text-caption text-muted">ink</text>
</view>
<view class="w-20 gap-1">
<view class="h-12 rounded-md bg-muted" />
<text class="text-caption text-muted">muted</text>
</view>
<view class="w-20 gap-1">
<view class="h-12 rounded-md bg-danger" />
<text class="text-caption text-muted">danger</text>
</view>
<view class="w-20 gap-1">
<view class="h-12 rounded-md bg-success" />
<text class="text-caption text-muted">success</text>
</view>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">text-* with a colour token</text>
<view class="row wrap gap-3 p-3 rounded-md bg-surface border">
<text class="text-label text-ink">ink</text>
<text class="text-label text-muted">muted</text>
<text class="text-label text-primary">primary</text>
<text class="text-label text-danger">danger</text>
<text class="text-label text-success">success</text>
<text class="px-2 rounded-sm bg-primary text-label text-on-primary">on-primary</text>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">text-* with a text style: the theme's text styles</text>
<view class="gap-2 p-3 rounded-md bg-surface border">
<text class="text-title text-ink">text-title</text>
<text class="text-heading text-ink">text-heading</text>
<text class="text-body text-ink">text-body</text>
<text class="text-label text-ink">text-label</text>
<text class="text-caption text-ink">text-caption</text>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
font-normal · font-medium · font-semibold · font-bold
</text>
<view class="row wrap gap-3 p-3 rounded-md bg-surface border">
<text class="text-body font-normal text-ink">normal</text>
<text class="text-body font-medium text-ink">medium</text>
<text class="text-body font-semibold text-ink">semibold</text>
<text class="text-body font-bold text-ink">bold</text>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">text-left · text-center · text-right</text>
<view class="gap-1 p-3 rounded-md bg-surface border">
<text class="text-left text-body text-ink">Left</text>
<text class="text-center text-body text-ink">Centre</text>
<text class="text-right text-body text-ink">Right</text>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">truncate · line-clamp-2 · line-clamp-3</text>
<view class="gap-3 p-3 rounded-md bg-surface border">
<text class="truncate text-body text-ink">
A single line that is far too long to fit on a phone screen, so it ends in an ellipsis.
</text>
<text class="line-clamp-2 text-body text-ink">
Two lines at most. The harbour was quiet that morning, the boats tied up in rows, the gulls
arguing over the last of the night's catch while the town slowly woke.
</text>
<text class="line-clamp-3 text-body text-muted">
Three lines at most. The harbour was quiet that morning, the boats tied up in rows, the
gulls arguing over the last of the night's catch while the town slowly woke and the first
ferry sounded its horn out past the breakwater.
</text>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
opacity-100 · opacity-75 · opacity-50 · opacity-25 · opacity-0
</text>
<view class="row gap-2">
<view class="grow h-12 rounded-md bg-primary opacity-100" />
<view class="grow h-12 rounded-md bg-primary opacity-75" />
<view class="grow h-12 rounded-md bg-primary opacity-50" />
<view class="grow h-12 rounded-md bg-primary opacity-25" />
<view class="grow h-12 rounded-md bg-primary opacity-0 border" />
</view>
</view>
</screen>pages/index.duo
<screen title="Utilities" class="p-4 gap-4 bg-canvas md:p-8 md:items-center">
<view class="gap-1 w-full md:max-w-96">
<text class="text-title text-ink">Utilities</text>
<text class="text-body text-muted">
A visual reference: every utility group on its own page, drawn with the utilities it shows.
</text>
</view>
<view class="gap-3 w-full md:max-w-96">
<view
class="row items-center gap-3 p-4 rounded-lg bg-surface border shadow-sm hover:shadow-md pressed:bg-raised"
href="/layout"
>
<view class="w-10 h-10 shrink-0 rounded-md bg-primary" />
<view class="grow gap-1">
<text class="text-label text-ink">Layout</text>
<text class="text-caption text-muted truncate">
row, items-*, justify-*, self-*, wrap, grow, position
</text>
</view>
</view>
<view
class="row items-center gap-3 p-4 rounded-lg bg-surface border shadow-sm hover:shadow-md pressed:bg-raised"
href="/spacing"
>
<view class="w-10 h-10 shrink-0 rounded-md bg-success" />
<view class="grow gap-1">
<text class="text-label text-ink">Spacing and sizing</text>
<text class="text-caption text-muted truncate">
p-*, gap-*, w-*, h-*, min-*, max-*, fractions, aspect-*
</text>
</view>
</view>
<view
class="row items-center gap-3 p-4 rounded-lg bg-surface border shadow-sm hover:shadow-md pressed:bg-raised"
href="/color"
>
<view class="w-10 h-10 shrink-0 rounded-md bg-danger" />
<view class="grow gap-1">
<text class="text-label text-ink">Colour and type</text>
<text class="text-caption text-muted truncate">
bg-*, text-*, font-*, text-center, truncate, line-clamp-*
</text>
</view>
</view>
<view
class="row items-center gap-3 p-4 rounded-lg bg-surface border shadow-sm hover:shadow-md pressed:bg-raised"
href="/borders"
>
<view class="w-10 h-10 shrink-0 rounded-full bg-ink" />
<view class="grow gap-1">
<text class="text-label text-ink">Borders, shadows and radius</text>
<text class="text-caption text-muted truncate">
border-*, rounded-*, shadow-*, opacity-*
</text>
</view>
</view>
<view
class="row items-center gap-3 p-4 rounded-lg bg-surface border shadow-sm hover:shadow-md pressed:bg-raised"
href="/states"
>
<view class="w-10 h-10 shrink-0 rounded-md bg-raised border-2 border-primary" />
<view class="grow gap-1">
<text class="text-label text-ink">States</text>
<text class="text-caption text-muted truncate">
pressed:, hover:, focus:, disabled:, dark:, md:, lg:
</text>
</view>
</view>
</view>
</screen>pages/layout.duo
<screen title="Layout" class="p-4 gap-6 bg-canvas">
<view class="row items-center justify-between">
<text class="text-title text-ink">Layout</text>
<text class="text-label text-primary" href="/">All utilities</text>
</view>
<view class="gap-2">
<text class="text-caption text-muted">a view is a column; row lays children side by side</text>
<view class="row gap-3">
<view class="grow gap-2 p-3 rounded-md bg-surface border">
<view class="h-6 rounded-sm bg-primary" />
<view class="h-6 rounded-sm bg-primary opacity-75" />
<view class="h-6 rounded-sm bg-primary opacity-50" />
</view>
<view class="grow row gap-2 p-3 rounded-md bg-surface border">
<view class="grow h-24 rounded-sm bg-primary" />
<view class="grow h-24 rounded-sm bg-primary opacity-75" />
<view class="grow h-24 rounded-sm bg-primary opacity-50" />
</view>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
row items-start · items-center · items-end · items-stretch
</text>
<view class="row gap-2">
<view class="grow row items-start gap-1 h-20 p-2 rounded-md bg-surface border">
<view class="w-4 h-6 rounded-sm bg-primary" />
<view class="w-4 h-10 rounded-sm bg-primary" />
</view>
<view class="grow row items-center gap-1 h-20 p-2 rounded-md bg-surface border">
<view class="w-4 h-6 rounded-sm bg-primary" />
<view class="w-4 h-10 rounded-sm bg-primary" />
</view>
<view class="grow row items-end gap-1 h-20 p-2 rounded-md bg-surface border">
<view class="w-4 h-6 rounded-sm bg-primary" />
<view class="w-4 h-10 rounded-sm bg-primary" />
</view>
<view class="grow row items-stretch gap-1 h-20 p-2 rounded-md bg-surface border">
<view class="w-4 rounded-sm bg-primary" />
<view class="w-4 rounded-sm bg-primary" />
</view>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
row justify-start · center · end · between · around · evenly
</text>
<view class="row justify-start gap-1 p-2 rounded-md bg-surface border">
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
</view>
<view class="row justify-center gap-1 p-2 rounded-md bg-surface border">
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
</view>
<view class="row justify-end gap-1 p-2 rounded-md bg-surface border">
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
</view>
<view class="row justify-between p-2 rounded-md bg-surface border">
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
</view>
<view class="row justify-around p-2 rounded-md bg-surface border">
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
</view>
<view class="row justify-evenly p-2 rounded-md bg-surface border">
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
<view class="w-8 h-4 rounded-sm bg-success" />
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">self-start · self-center · self-end · self-stretch</text>
<view class="gap-1 p-2 rounded-md bg-surface border">
<view class="self-start w-20 h-4 rounded-sm bg-danger" />
<view class="self-center w-20 h-4 rounded-sm bg-danger" />
<view class="self-end w-20 h-4 rounded-sm bg-danger" />
<view class="self-stretch h-4 rounded-sm bg-danger" />
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">row wrap · grow · shrink-0</text>
<view class="row wrap gap-2 p-2 rounded-md bg-surface border">
<text class="px-3 py-1 rounded-full bg-raised text-caption text-ink">wrap</text>
<text class="px-3 py-1 rounded-full bg-raised text-caption text-ink">onto</text>
<text class="px-3 py-1 rounded-full bg-raised text-caption text-ink">more</text>
<text class="px-3 py-1 rounded-full bg-raised text-caption text-ink">lines</text>
<text class="px-3 py-1 rounded-full bg-raised text-caption text-ink">when</text>
<text class="px-3 py-1 rounded-full bg-raised text-caption text-ink">a row</text>
<text class="px-3 py-1 rounded-full bg-raised text-caption text-ink">is full</text>
</view>
<view class="row items-center gap-2 p-2 rounded-md bg-surface border">
<view class="shrink-0 w-12 h-12 rounded-full bg-primary" />
<text class="grow truncate text-body text-ink">
grow takes what is left; shrink-0 keeps the circle round
</text>
<text class="shrink-0 text-caption text-muted">2m</text>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">relative · absolute · inset-0 · top-* right-* · z-*</text>
<view class="row gap-4">
<view class="relative w-24 h-24 rounded-lg overflow-hidden bg-primary">
<view class="absolute inset-0 bg-ink opacity-25" />
<text class="absolute bottom-2 left-2 text-caption text-on-primary">inset-0</text>
</view>
<view class="relative w-24 h-24">
<view class="w-24 h-24 rounded-full bg-raised border" />
<view
class="absolute top-0 right-0 z-10 w-6 h-6 rounded-full bg-danger border-2 border-surface"
/>
</view>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">hidden · md:flex · col md:row (widen the window)</text>
<view class="col md:row gap-2 p-2 rounded-md bg-surface border">
<text class="grow p-2 rounded-sm bg-raised text-caption text-ink">One</text>
<text class="grow p-2 rounded-sm bg-raised text-caption text-ink">Two</text>
<text class="hidden md:flex grow p-2 rounded-sm bg-primary text-caption text-on-primary">
Only when md
</text>
</view>
</view>
</screen>pages/spacing.duo
<screen title="Spacing and sizing" class="p-4 gap-6 bg-canvas">
<view class="row items-center justify-between">
<text class="text-title text-ink">Spacing and sizing</text>
<text class="text-label text-primary" href="/">All utilities</text>
</view>
<view class="gap-2">
<text class="text-caption text-muted">p-1 · p-2 · p-4 · p-6 (padding shown in colour)</text>
<view class="row items-start gap-2">
<view class="p-1 rounded-sm bg-primary">
<view class="w-10 h-10 rounded-sm bg-surface" />
</view>
<view class="p-2 rounded-sm bg-primary">
<view class="w-10 h-10 rounded-sm bg-surface" />
</view>
<view class="p-4 rounded-sm bg-primary">
<view class="w-10 h-10 rounded-sm bg-surface" />
</view>
<view class="p-6 rounded-sm bg-primary">
<view class="w-10 h-10 rounded-sm bg-surface" />
</view>
</view>
<text class="text-caption text-muted">px-6 py-1 · pt-4 · pb-4</text>
<view class="row items-start gap-2">
<view class="px-6 py-1 rounded-sm bg-success">
<view class="w-10 h-10 rounded-sm bg-surface" />
</view>
<view class="pt-4 rounded-sm bg-success">
<view class="w-10 h-10 rounded-sm bg-surface" />
</view>
<view class="pb-4 rounded-sm bg-success">
<view class="w-10 h-10 rounded-sm bg-surface" />
</view>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">gap-1 · gap-3 · gap-6</text>
<view class="row gap-1">
<view class="w-8 h-8 rounded-sm bg-danger" />
<view class="w-8 h-8 rounded-sm bg-danger" />
<view class="w-8 h-8 rounded-sm bg-danger" />
<view class="w-8 h-8 rounded-sm bg-danger" />
</view>
<view class="row gap-3">
<view class="w-8 h-8 rounded-sm bg-danger" />
<view class="w-8 h-8 rounded-sm bg-danger" />
<view class="w-8 h-8 rounded-sm bg-danger" />
<view class="w-8 h-8 rounded-sm bg-danger" />
</view>
<view class="row gap-6">
<view class="w-8 h-8 rounded-sm bg-danger" />
<view class="w-8 h-8 rounded-sm bg-danger" />
<view class="w-8 h-8 rounded-sm bg-danger" />
<view class="w-8 h-8 rounded-sm bg-danger" />
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
w-8 · w-16 · w-24 · w-32 · w-48 · w-64 (space tokens)
</text>
<view class="w-8 h-4 rounded-sm bg-primary" />
<view class="w-16 h-4 rounded-sm bg-primary" />
<view class="w-24 h-4 rounded-sm bg-primary" />
<view class="w-32 h-4 rounded-sm bg-primary" />
<view class="w-48 h-4 rounded-sm bg-primary" />
<view class="w-64 h-4 rounded-sm bg-primary" />
</view>
<view class="gap-2">
<text class="text-caption text-muted">w-1/4 · w-1/3 · w-1/2 · w-2/3 · w-3/4 · w-full</text>
<view class="gap-1 p-2 rounded-md bg-surface border">
<view class="w-1/4 h-4 rounded-sm bg-success" />
<view class="w-1/3 h-4 rounded-sm bg-success" />
<view class="w-1/2 h-4 rounded-sm bg-success" />
<view class="w-2/3 h-4 rounded-sm bg-success" />
<view class="w-3/4 h-4 rounded-sm bg-success" />
<view class="w-full h-4 rounded-sm bg-success" />
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">h-8 · h-12 · h-16 · h-20 inside h-24 · h-full</text>
<view class="row items-end gap-2 h-24 p-2 rounded-md bg-surface border">
<view class="w-8 h-8 rounded-sm bg-primary" />
<view class="w-8 h-12 rounded-sm bg-primary" />
<view class="w-8 h-16 rounded-sm bg-primary" />
<view class="w-8 h-20 rounded-sm bg-primary" />
<view class="w-8 h-full rounded-sm bg-ink" />
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
min-w-24 keeps a short label wide · max-w-48 wraps a long one
</text>
<view class="row items-start gap-2">
<text class="min-w-24 px-3 py-2 rounded-md bg-raised text-caption text-ink text-center">
OK
</text>
<text class="max-w-48 px-3 py-2 rounded-md bg-raised text-caption text-ink">
A longer label that would run on, capped by max-w-48
</text>
</view>
<text class="text-caption text-muted">min-h-16 · max-h-12 overflow-hidden</text>
<view class="row items-start gap-2">
<view class="min-h-16 w-24 p-2 rounded-md bg-surface border">
<text class="text-caption text-ink">min-h-16</text>
</view>
<view class="max-h-12 w-48 p-2 overflow-hidden rounded-md bg-surface border">
<text class="text-caption text-ink">
max-h-12 clips this text once it grows past three lines of caption text, so the rest is
hidden.
</text>
</view>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
aspect-square · aspect-video (set the width, the height follows)
</text>
<view class="row items-start gap-2">
<view class="w-24 aspect-square rounded-md bg-danger" />
<view class="w-48 aspect-video rounded-md bg-ink" />
</view>
</view>
</screen>pages/states.duo
---
import { state } from "@duolith/client";
let presses = state(0);
let note = state("");
function press() {
presses = presses + 1;
}
---
<screen title="States" class="p-4 gap-6 bg-canvas">
<view class="row items-center justify-between">
<text class="text-title text-ink">States</text>
<text class="text-label text-primary" href="/">All utilities</text>
</view>
<view class="gap-2">
<text class="text-caption text-muted">pressed:bg-ink pressed:opacity-75 (every target)</text>
<button
class="px-4 py-3 rounded-md bg-primary text-label text-on-primary pressed:bg-ink pressed:opacity-75"
on:press={press}
>
Pressed {presses} times
</button>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
hover:bg-raised hover:shadow-md (web only; never on iOS and Android)
</text>
<button
class="px-4 py-3 rounded-md bg-surface border text-label text-ink hover:bg-raised hover:shadow-md pressed:bg-border"
>
Rest a pointer here
</button>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
focus:border-primary focus:shadow-md (keyboard focus; on iOS and Android only a field takes
it)
</text>
<input
class="px-3 py-2 rounded-md bg-surface border-2 text-body text-ink focus:border-primary focus:shadow-md"
label="Note"
placeholder="Press Tab to focus"
value={note}
on:input={(event) => (note = event.value)}
/>
<button
class="px-4 py-3 rounded-md bg-raised text-label text-ink focus:bg-primary focus:text-on-primary pressed:bg-border"
>
Tab to me
</button>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
disabled:opacity-50 disabled:bg-raised disabled:text-muted
</text>
<button
class="px-4 py-3 rounded-md bg-primary text-label text-on-primary disabled:opacity-50 disabled:bg-raised disabled:text-muted"
>
Save
</button>
</view>
<view class="gap-2">
<text class="text-caption text-muted">
dark:border-2 dark:border-primary (only in dark mode)
</text>
<view class="p-4 rounded-lg bg-surface border dark:border-2 dark:border-primary">
<text class="text-body text-ink">
Colours swap by themselves; dark: is for changes that are not a colour swap.
</text>
</view>
</view>
<view class="gap-2">
<text class="text-caption text-muted">md:row md:p-6 lg:bg-raised (window sizes)</text>
<view class="gap-2 p-3 rounded-lg bg-surface border md:row md:p-6 lg:bg-raised">
<text class="grow p-3 rounded-md bg-canvas text-body text-ink">Stacked on a phone</text>
<text class="grow p-3 rounded-md bg-canvas text-body text-ink">side by side from md</text>
<text class="grow p-3 rounded-md bg-canvas text-body text-ink">raised from lg</text>
</view>
</view>
</screen>