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

FileWhatWhere
priv/static/images/karta-mascot.svgThe 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.svgThe 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 empty alt; 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-mascot under prefers-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."

NameValueUse
Airmail Blue#14254aThe wordmark; primary buttons (light scheme); the mark's tile.
Flamingo Pink#f86a79The marker of the current navigation item; the airmail band; the mascot. Never text: it is too light on white (2.9:1).
Flamingo Deep#f9435bThe keyboard focus ring (light scheme, 3.5:1 on white).
Paper#f9efd7The background of the sign-in pages; the gaps of the airmail band.
Airmail stripe blue#4d8fd6The 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 in priv/static/fonts/OFL.txt) for the wordmark and for headings (h1–h3, through font-display). Its rounded forms carry the brand's voice.
  • The system's UI font (font-sans: system-ui and 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-nums is 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):

RoleSizeWeightClass
Page title20 px, 24 px from sm600<.header>
Panel title15 px600<.panel title>
Body, tables, inputs14 px400default
Secondary text, help, captions13 px400text-[0.8125rem] text-muted
Table headings, badges12 px500text-xs
Wordmark22 px (sidebar), 48–60 px (sign-in)800k-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.

TokenLightDarkUse
canvas#f5f6f9#101116The page behind the panels.
surface#ffffff#17181fPanels, the sidebar, the top bar, inputs.
sunken#eef0f4#1e2029Table headings, code, hover.
line#dfe2e9#2a2d39Borders and dividers.
line-strong#8a90a2#6b7184Input borders (3:1 against their surface).
ink#16161b#ecedf2Text.
muted#5a6072#a3a8b8Secondary text (≥ 5.4:1 on surface and sunken).
link#285293#9cc0f2Links in text and tables.
primary / on-primary#14254a / white#a9c4f0 / #14254aThe primary button.
brand#f86a79#f86a79Current navigation item marker.
brand-soft#fee8ea#3a1c24Current navigation item background.
focus#f9435b#f86a79The focus ring.
danger / on-danger#b42318 / white#ff8a80 / #16161bButtons that remove or stop.
paper#f9efd7#1b2440The sign-in pages' background.
chart#4d8fd6#6fa6e0Bars 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):

ToneLight (text / soft)Dark (text / soft)Means
ok#157a43 / #e3f4ea#6fd39a / #13301fDone, working: delivered, active, verified.
warn#8a5300 / #fff1d6#f5c26b / #33260eWaiting or needs attention: deferred, suspended, not verified, retiring.
bad#b42318 / #fde8e6#ff8a80 / #3a1715Failed for good: bounced; errors.
info#2d47a0 / #e6ecfa#a9bcf5 / #1b2442Neutral events: pending, opened, clicked.
neutral#4a5063 / #edeff3#b4b9c8 / #252833Not started or over: queued, revoked, retired.
violet#6941c6 / #f0ebfc#c4b0f5 / #2a2142Deliberately 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 from lg; 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 and aria-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-cell on 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.

ComponentFor
<.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/1The 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/1The 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).

ValueWordsToneIcon
:queuedQueuedneutralclock
:deferredDeferredwarnarrow-path
:deliveredDeliveredokcheck
:bouncedBouncedbadx-mark
:suppressedSuppressedvioletno-symbol
:acceptedStoredneutralinbox
:heldHeldwarnhand-raised
:parsedReadokdocument-check
:held_hereHeld hereokcheck-circle
:not_hereNot on this nodeneutralminus-circle
:activeActiveokcheck
:suspendedSuspendedwarnpause
:revokedRevokedneutralno-symbol
:verifiedVerifiedokcheck-badge
:unverifiedNot verifiedwarnexclamation-triangle
:pendingPendinginfoclock
:retiringRetiringwarnarrow-down-circle
:retiredRetiredneutralarchive-box
:openOpenedinfoeye
:clickClickedinfocursor-arrow-rays
:passOKokcheck-circle
:warnWarningwarnexclamation-triangle
:failProblembadx-circle
:missingNot set upneutralminus-circle
:onOnokcheck
:offOffneutralpause
:failingFailingwarnexclamation-triangle
:stoppedStoppedbadx-circle
:succeededSucceededokcheck
:retryingRetryingwarnarrow-path
:failedFailedbadx-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 localhost in 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 focus token, 2 px offset) shows on :focus-visible only.
  • Structure: one h1 per page (<.header>), h2 per panel; landmarks (nav "Main", nav "Breadcrumbs", main); tables with th scope="col"; every input with a label; 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 an aria-label.
  • Flash notices are role="status" (errors role="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: reduce there 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 style attribute 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 no on… attributes. Browser code is a colocated hook (<script :type={Phoenix.LiveView.ColocatedHook}>, as <.copy_button> does), which is bundled into app.js, or LiveView's JS commands in phx-* attributes.
  • Fonts and images from Karta only (/fonts, /images).
  • test/karta_web/security_headers_test.exs renders every page, before and after the LiveView connects, and fails on any of the above; add a new page's path there.