Admin design system
How Karta's admin interface looks and why: the brand, the colour tokens,
type, spacing, the components and the rules every page follows. The
components live in KartaWeb.CoreComponents and KartaWeb.Layouts, the
tokens in assets/css/app.css; this page and that code change together.
What the pages are and how to add one is in
Admin interface; pages that update by themselves are
in Live updates.
Direction
The admin interface is a tool for operators who look at a lot of mail: dense tables, exact values (ids, reply codes, DNS records), states that can be read at a glance. It is calm and functional, with one ornament and one character:
- The airmail band: the striped edge of an airmail envelope (flamingo pink and airmail blue on paper) runs along the top of every page. It is the only decoration; nothing else is striped, tilted or gradient.
- The mascot: a flamingo in flight carrying a bag of letters. It stands next to the name in the sidebar and on the sign-in page, and nowhere else.
Everything else is quiet: white or near-black surfaces, thin lines, one blue for actions, colour reserved for states.
Brand
The mascot and the name
| File | What | Where |
|---|---|---|
priv/static/images/karta-mascot.svg | The flamingo with its bag of letters (the bag carries a postage stamp with the flag of Bonaire). Wide (986 × 606). | The sidebar (36 px high), the sign-in page (64–80 px), the documentation. |
priv/static/images/karta-mark.svg | The mark: the flamingo's head with the black-tipped beak holding the bag (with its stamp), on an airmail blue tile with rounded corners. Square. | The favicon and any place under 28 px. |
- The name is never part of the image. "Karta" is HTML text next to
the mascot, the wordmark: Nunito ExtraBold (800), letter spacing
−0.015 em, airmail blue (
#14254a) on light backgrounds and white on dark ones (k-wordmark). The image then has an emptyalt; the text names the product. - Lockup: the mascot, then the wordmark, centred on each other vertically; the gap is a quarter of the mascot's height; the wordmark's cap height is about half the mascot's height.
- Clear space: keep a quarter of the mascot's height free on every side of the lockup.
- Minimum size: the mascot at least 28 px high (the wing band and the bag must stay readable); below that use the mark, which works down to 16 px.
- Dark backgrounds: the mascot is one drawing for both colour schemes.
Its navy wing band and outlines get a light halo from the stylesheet
(
.k-mascotunderprefers-color-scheme: dark:filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 0.5px #fff)); the mark needs none (it brings its own tile). - Do not recolour, outline, rotate or crop the mascot, put text into it, or set it on a busy background.
- Both files use presentation attributes only: no
<style>, no script, no link to anything outside the file. A test checks that, so that they can be served under the admin pages' content security policy.
Colours
"The colours of Karta are Airmail Blue and Flamingo Pink."
| Name | Value | Use |
|---|---|---|
| Airmail Blue | #14254a | The wordmark; primary buttons (light scheme); the mark's tile. |
| Flamingo Pink | #f86a79 | The marker of the current navigation item; the airmail band; the mascot. Never text: it is too light on white (2.9:1). |
| Flamingo Deep | #f9435b | The keyboard focus ring (light scheme, 3.5:1 on white). |
| Paper | #f9efd7 | The background of the sign-in pages; the gaps of the airmail band. |
| Airmail stripe blue | #4d8fd6 | The blue stripes of the band; the bars of charts. |
Typography
- Nunito (SIL Open Font License;
priv/static/fonts/nunito-latin.woff2, a Latin subset of the variable font, 200–1000; licence inpriv/static/fonts/OFL.txt) for the wordmark and for headings (h1–h3, throughfont-display). Its rounded forms carry the brand's voice. - The system's UI font (
font-sans:system-uiand its fallbacks) for everything else: body text, tables, forms, numbers. It is the most legible face on each platform at small sizes, and it has tabular figures (tabular-numsis on for the whole page, so columns of numbers line up; Nunito has none). - The system's monospace font (
font-mono) for values that are copied or compared character by character: ids, tokens, keys, DNS records, Message-IDs, header fields, scopes.
Scale (rem at a 16 px root; the body is 14 px):
| Role | Size | Weight | Class |
|---|---|---|---|
| Page title | 20 px, 24 px from sm | 600 | <.header> |
| Panel title | 15 px | 600 | <.panel title> |
| Body, tables, inputs | 14 px | 400 | default |
| Secondary text, help, captions | 13 px | 400 | text-[0.8125rem] text-muted |
| Table headings, badges | 12 px | 500 | text-xs |
| Wordmark | 22 px (sidebar), 48–60 px (sign-in) | 800 | k-wordmark |
Text is set in sentence case; no all-capitals labels.
Colour tokens
Every colour on a page is a token, defined once per colour scheme on
:root (--k-*) and exposed to Tailwind (bg-surface, text-muted,
border-line, …). The scheme follows the browser (prefers-color-scheme);
there is no switch, because a switch would need a script before the first
paint, which the content security policy does not allow inline. Pages use
the tokens only: never a raw colour, never dark: variants.
| Token | Light | Dark | Use |
|---|---|---|---|
canvas | #f5f6f9 | #101116 | The page behind the panels. |
surface | #ffffff | #17181f | Panels, the sidebar, the top bar, inputs. |
sunken | #eef0f4 | #1e2029 | Table headings, code, hover. |
line | #dfe2e9 | #2a2d39 | Borders and dividers. |
line-strong | #8a90a2 | #6b7184 | Input borders (3:1 against their surface). |
ink | #16161b | #ecedf2 | Text. |
muted | #5a6072 | #a3a8b8 | Secondary text (≥ 5.4:1 on surface and sunken). |
link | #285293 | #9cc0f2 | Links in text and tables. |
primary / on-primary | #14254a / white | #a9c4f0 / #14254a | The primary button. |
brand | #f86a79 | #f86a79 | Current navigation item marker. |
brand-soft | #fee8ea | #3a1c24 | Current navigation item background. |
focus | #f9435b | #f86a79 | The focus ring. |
danger / on-danger | #b42318 / white | #ff8a80 / #16161b | Buttons that remove or stop. |
paper | #f9efd7 | #1b2440 | The sign-in pages' background. |
chart | #4d8fd6 | #6fa6e0 | Bars and lines of charts. |
Status tones, each a strong colour for text and icons and a soft one for backgrounds (text on its soft colour ≥ 4.7:1 in both schemes):
| Tone | Light (text / soft) | Dark (text / soft) | Means |
|---|---|---|---|
ok | #157a43 / #e3f4ea | #6fd39a / #13301f | Done, working: delivered, active, verified. |
warn | #8a5300 / #fff1d6 | #f5c26b / #33260e | Waiting or needs attention: deferred, suspended, not verified, retiring. |
bad | #b42318 / #fde8e6 | #ff8a80 / #3a1715 | Failed for good: bounced; errors. |
info | #2d47a0 / #e6ecfa | #a9bcf5 / #1b2442 | Neutral events: pending, opened, clicked. |
neutral | #4a5063 / #edeff3 | #b4b9c8 / #252833 | Not started or over: queued, revoked, retired. |
violet | #6941c6 / #f0ebfc | #c4b0f5 / #2a2142 | Deliberately not sent: suppressed. |
Pink is the brand's colour, not a state's: no state uses it, so that the current navigation item is never mistaken for an error.
Space, size and density
- A 4 px grid (Tailwind's spacing scale). Page gutters 16 px on phones,
24 px from
sm, 32 px fromlg; content at most 72 rem (1152 px) wide. - Between panels 24 px (
space-y-6); inside a panel 16 px (p-4); a form's fields 16–20 px apart (space-y-4). - Tables are dense: cells 12 px × 8 px, 14 px text, a single line where possible. Rows are not striped; a row is highlighted on hover.
- Controls are 36 px high (
h-9), 28 px for small buttons in tables and panel headers (size="sm"). Click targets are at least 24 × 24 px (WCAG 2.2, 2.5.8). - Corners: 6 px for controls (
rounded-md), 8 px for panels (rounded-lg), 12 px for the sign-in card; badges are pills.
Layout
The signed-in pages share one shell (KartaWeb.Layouts.app/1):
┌airmail band──────────────────────────────────────────────────────────────┐
│ [mascot] Karta │ Organisations › Shop › Shop mail › Messages ann@… Sign out
│ ├───────────────────────────────────────────────────────┤
│ ▢ Organisations │ Messages │
│ │ What Shop mail accepted, newest first, … [actions] │
│ Organisation │ │
│ Shop │ ┌ suspended notice (on every page of a suspended server)
│ ▢ Overview │ ┌panel───────────────────────────────────────────────┐│
│ ▢ Domains │ │ title [actions] ││
│ ▢ Members │ ├────────────────────────────────────────────────────┤│
│ │ │ table / form / list ││
│ Mail server │ └────────────────────────────────────────────────────┘│
│ Shop mail │ ┌panel───────────────────────────────────────────────┐│
│ ▌▢ Overview │ │ … ││
│ ▢ Messages │ │
│ ▢ Credentials │ │
│ ▢ Settings │ │
└──────────────────┴───────────────────────────────────────────────────────┘- Sidebar (16 rem): its column runs the whole height of the page
(the background and the border are the column's), and the sidebar in it
is sticky, with a scroll of its own when it is taller than the window.
It holds the lockup, then one section per level of the page's context:
the instance, the organisation, the mail server. A
section names its record (with its kind above it, "Organisation", "Mail
server") and links to its overview; its items are the areas of that
record (
KartaWeb.Navigation). The current item has a pink marker on the left, a pink-tinted background andaria-current="page". - Top bar: the breadcrumbs (the trail of records to the page; the last crumb is the page and is not a link), the signed-in user (to the account page) and Sign out.
- Page:
<.header>(title, one line of context, the page's own actions on the right), then panels. Full-width panels by default; two columns only where two independent things sit side by side (grid gap-6 lg:grid-cols-2), and the more important one first. - Below 1024 px the sidebar is hidden behind the menu button in the top
bar, the breadcrumbs show only the current page, and tables scroll
sideways inside their panel; the page itself never scrolls sideways.
Columns that can go are hidden below a breakpoint (
hidden md:table-cellon the column); the column that names a row and its state always stay.
The pages before sign-in use KartaWeb.Layouts.auth/1: the band, the
lockup on paper, one card 24 rem wide.
Components
All in KartaWeb.CoreComponents (with examples in their docs) unless
noted. A page uses these and adds layout utilities (grid, flex, gap,
widths) only; a new pattern becomes a component with a test and a line
here before a second page needs it.
| Component | For |
|---|---|
<.header> | The page's title, its context line, its actions. |
<.panel> | A titled section; flush for a table that fills it; :actions in its header. |
<.table> | Every list of records (lists or streams); class on a column aligns numbers (text-right) or hides it on small screens. Row actions are ghost or danger-ghost small buttons. |
<.list> | Facts about one record: a term and its value per row. |
<.empty_state> | What an empty list says: what is missing and what to do about it. Every list has one, with an id (no-…). |
<.button> | Actions; a link when it navigates. primary once per form or page (the main action), secondary for the rest, ghost in tables and toolbars, danger and danger-ghost for what removes or stops (always with data-confirm). |
<.input> | Every form field: label above, help below, errors below that. |
<.file_input> | The file field of a LiveView upload, laid out as <.input>; what is wrong with the file (too large, not accepted) in words below it. |
<.state> | The state of a record (below). |
<.badge> | A short label: tags, scopes, "This session", what publishing would do to a record ("Add" ok, "Replace" and "Take over" info, "Remove" warn, "Left alone" bad). |
<.callout> | A notice in the page: a suspended server, a failure to read something, a secret shown once. |
<.flash> | The result of an action, at the top right; Layouts.flash_group/1 holds them and the connection notices. |
<.timestamp> | Every time: UTC, 2026-11-08 14:03 UTC, in a <time datetime>; precision :second where seconds matter (messages, deliveries), :day for dates. |
<.copyable> | A value to copy (a token, an id): monospace, broken anywhere, with a copy button. |
<.copy_button> | Copies the text of another element by selector, so a secret is in the page once; says "Copied" for two seconds (and to screen readers). |
<.dns_record> | A record to publish: type, name and value, the name and the value each with a copy button; a long TXT value as quoted strings of at most 255 octets. |
<.secret> | A key or password shown once: the value, a copy button, "Copy it now. Karta keeps only a hash of it and cannot show it again", and the action that dismisses it. |
<.stat> | A number to take in at a glance, with its label and an icon in the state's tone. |
<.bar_chart> | A series of counts as bars (below). |
<.pager> | Previous and next for keyset pages (Karta.Pager). |
<.live_badge> | "Live" in the header of a panel that updates by itself; shown only while the page is connected. |
changed_class/1 | The short highlight of a row that changed in a live update (row_class on <.table>); none with reduced motion. |
<.icon> | Heroicons (outline 24, mini 20, micro 16), decorative (aria-hidden). |
Layouts.logo/1 | The mascot, its height from class. |
States
<.state value={…}> is the only way a page shows a state: the words, a
tone and an icon together, so that no state depends on colour alone. With
count it reads "3 delivered" (the messages list shows a message's
recipients that way).
| Value | Words | Tone | Icon |
|---|---|---|---|
:queued | Queued | neutral | clock |
:deferred | Deferred | warn | arrow-path |
:delivered | Delivered | ok | check |
:bounced | Bounced | bad | x-mark |
:suppressed | Suppressed | violet | no-symbol |
:accepted | Stored | neutral | inbox |
:held | Held | warn | hand-raised |
:parsed | Read | ok | document-check |
:held_here | Held here | ok | check-circle |
:not_here | Not on this node | neutral | minus-circle |
:active | Active | ok | check |
:suspended | Suspended | warn | pause |
:revoked | Revoked | neutral | no-symbol |
:verified | Verified | ok | check-badge |
:unverified | Not verified | warn | exclamation-triangle |
:pending | Pending | info | clock |
:retiring | Retiring | warn | arrow-down-circle |
:retired | Retired | neutral | archive-box |
:open | Opened | info | eye |
:click | Clicked | info | cursor-arrow-rays |
:pass | OK | ok | check-circle |
:warn | Warning | warn | exclamation-triangle |
:fail | Problem | bad | x-circle |
:missing | Not set up | neutral | minus-circle |
:on | On | ok | check |
:off | Off | neutral | pause |
:failing | Failing | warn | exclamation-triangle |
:stopped | Stopped | bad | x-circle |
:succeeded | Succeeded | ok | check |
:retrying | Retrying | warn | arrow-path |
:failed | Failed | bad | x-mark |
:pass, :warn, :fail and :missing are a DNS check's result and each
of its findings (:pending before its first result). A webhook is :on,
:failing (on, its requests failing), :off (switched off by someone) or
:stopped (switched off by Karta because its requests kept failing); a
webhook delivery is :pending, :retrying (pending after a failed
request), :succeeded or :failed (a dead letter); a received report is
:parsed (it was read) or :failed (it was not, and says why).
States that later areas add get a row here and in the component's map: an
import's running / done / failed (info / ok / bad).
Charts
Charts are SVG drawn on the server: no chart library, no script, no
style attribute (SVG presentation attributes and classes are allowed by
the policy). <.bar_chart> scales bars to the largest value, draws empty
buckets as a hairline, gives every bar a <title> (its label and value,
the tooltip) and the whole chart role="img" with an aria-label that
says what it shows and the total. Bars use the chart token; a chart with
several series uses the status tones for states (delivered ok, deferred
warn, bounced bad) and otherwise chart and primary. Axes are text
under the chart, not inside it. Later charts (stacked bars per state, a
sparkline in a table cell, a line for queue depth) follow the same rules
and get their own component.
Values to copy, secrets
- A secret (an API key, an SMTP password, a webhook signing secret) is held
only in the LiveView process, rendered once inside
<.secret>, and dropped by its dismiss action or by leaving the page. Never in the flash, the URL, a data attribute or the database.kept="encrypted"says so for a secret Karta keeps to sign with (a webhook's); the default says Karta keeps only a hash. A page that reads a record carrying a secret keeps a summary of it without the secret (KartaWeb.WebhookLive.Summary). - The clipboard needs a secure context (HTTPS, or
localhostin development). Without it the copy button does nothing and the value can still be selected by hand.
Mail content
A message's HTML part is shown in a sandboxed frame (no scripts, an origin
of its own, nothing remote; see Managing organisations, servers and
keys). Mail is written for a white page, so
the frame is white in both colour schemes, with a border that sets it off
from a dark page. The frame cannot fit itself to its content (its document
runs no script, and the page cannot read a document of another origin), so
its height follows the size of the HTML part (14 rem up to 2 KB, 24 rem up
to 16 KB, 36 rem above) and the reader can drag its lower edge
(resize-y). A message without an HTML part shows no frame, only its text.
Confirmations
Actions that remove, revoke, suspend or cannot be undone carry
data-confirm with a question that names the thing and the consequence
("Revoke Shop backend? Anything using it stops working."). The browser's
own dialog is used (LiveView handles data-confirm in app.js); a styled
dialog would need its own component with focus trapping.
Writing
- Name things as an operator would: mail server, domain, credential, recipient, delivery attempt.
- Buttons say what happens: "Add the server", "Revoke", "Generate a key"; the flash after it says it happened: "Server created.", "Shop backend revoked.".
- Errors say what is wrong and what to do; empty states say what will appear and how to make it appear.
- Times are UTC and say so; sizes in bytes, KB and MB; counts as numbers.
Accessibility
The target is WCAG 2.2 AA.
- Contrast: text ≥ 4.5:1, large text and UI parts (input borders, focus ring, icons that carry meaning) ≥ 3:1, in both schemes (the tables above were checked).
- Keyboard: everything works with the keyboard in reading order. A "Skip
to the content" link is the first thing on every page; the focus ring
(2 px, the
focustoken, 2 px offset) shows on:focus-visibleonly. - Structure: one
h1per page (<.header>),h2per panel; landmarks (nav"Main",nav"Breadcrumbs",main); tables withth scope="col"; every input with alabel; a field's errors right under it. - State is never colour alone (
<.state>); icons are decorative and the words carry the meaning; icon-only buttons have anaria-label. - Flash notices are
role="status"(errorsrole="alert") in a polite live region; the copy button announces "Copied". - Motion: only transitions that answer an action (a flash appearing, the
menu) or a change (the highlight of a row a live page updated); with
prefers-reduced-motion: reducethere is none. - Zoom to 200 % and a 320 px wide window work without sideways page scrolling (WCAG 1.4.10).
The content security policy
The admin pages are served with script-src 'self'; style-src 'self'
and no unsafe-inline (see the router). Therefore:
- No
styleattribute and no<style>element, in templates or in what components render: sizes, positions and colours are classes. Data that needs a size (a bar's height) goes into SVG attributes. - No inline
<script>and noon…attributes. Browser code is a colocated hook (<script :type={Phoenix.LiveView.ColocatedHook}>, as<.copy_button>does), which is bundled intoapp.js, or LiveView'sJScommands inphx-*attributes. - Fonts and images from Karta only (
/fonts,/images). test/karta_web/security_headers_test.exsrenders every page, before and after the LiveView connects, and fails on any of the above; add a new page's path there.