Design system
How Kantoor looks and why: the brand, the colour tokens, type, spacing, the
components and the rules every page follows. The components live in
KantoorWeb.CoreComponents and KantoorWeb.Layouts, the tokens in
assets/css/app.css; this page and that code change together.
Kantoor shares one design vein with Karta and Salt DNS: the same skeleton, the same token names, the same components by the same names, each with its own character. Karta is the reference implementation. If you know one of the three admin interfaces you can read the other two.
Direction
Kantoor is the app people live in all day: mail, calendar, tasks and contacts. It is calm and roomy where people read (messages, the calendar) and dense only where operators work (the admin pages). It has one ornament and one character:
- The ledger band: the ruled edge of a ledger page, a green rule and a thin
ink rule on paper, runs along the top of every page. A short yellow tab at its
left end is the one touch of the character's yellow. It is pure CSS (
.kt-ledger), and the only decoration: nothing else is striped, tilted or a gradient. - The mark: one image, used at every size: a lora (Bonaire's yellow-shouldered parrot) mid-sentence in conversation with a barika hel (the bananaquit, Bonaire's small yellow-breasted songbird), whose beak enters from the right, on a rounded yellow tile. A busy office. The artwork is by Shiloh B.V. 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 green for actions, colour reserved for states.
Brand
The mascot and the name
| File | What | Where |
|---|---|---|
priv/static/images/kantoor-mark.svg | The mark: a square, rounded yellow tile (viewBox 440 × 440) cropped onto the lora, with the barika hel's beak. | Beside the wordmark in the sidebar (36 px) and the top bar (28 px), large on the sign-in and start page (128 px), the favicon and the app icons. |
The file is a large traced drawing (about 220 KB): it is only ever referenced
with <img>, never inlined. It is a self-contained tile, so it looks the same on
white, paper and dark surfaces and needs no halo. Every image slot has a fixed
height and width: auto. Layouts.logo/1 renders it.
The app icons are generated from the mark with the headless browser and Pillow:
priv/static/images/icon-192.png, icon-512.png and apple-touch-icon.png
(180 px, on the tile's yellow), and priv/static/favicon.ico (16, 32, 48 and
64 px). priv/static/manifest.webmanifest names the app and points at the
icons. Regenerate them when the artwork changes.
- The name is never part of the image. "Kantoor" is HTML text next to the
mascot: Nunito ExtraBold (800), letter spacing −0.015 em, ledger green on
light backgrounds and white on dark ones (
.kt-wordmark). The image has an emptyalt; the text names the product. - Lockup: the mark, then the wordmark, centred on each other vertically; the gap is about a quarter of the mascot's height. Keep a quarter of the mascot's height free on every side.
- Do not recolour, outline, rotate or crop the artwork, 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.
Colours
"The colours of Kantoor are Ledger Green and Lora Green, on paper."
| Name | Value | Use |
|---|---|---|
| Ledger green | #12403a | The wordmark, primary buttons (light scheme), the ink rule of the band. |
| Lora green | #3fae6a | The marker of the current navigation item, unread mail, the green rule of the band. Never body text: it is too light on white. |
| Lora yellow | #f2c230 | The tab of the band. Nowhere else. (The mark brings its own colours.) |
| Paper | #f6f1e1 | The background of the sign-in page and the band. |
Colour tokens
Every colour on a page is a token, defined once per colour scheme on :root
(--kt-*) and exposed to Tailwind under the suite's shared names (bg-surface,
text-muted, border-line, …). The scheme follows the browser
(prefers-color-scheme); there is no switch, because a switch needs a script
before the first paint, which the content security policy does not allow. Pages
use the tokens only: never a raw colour, never a dark: variant.
| 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 or more on surface and sunken). |
link | #1a5c52 | #8fd4a8 | Links in text and tables (7.8:1 light, 10.2:1 dark on surface). |
primary / on-primary | #12403a / white | #8fd4a8 / #0c2a25 | The primary button (11.5:1 light, 8.9:1 dark). |
brand | #3fae6a | #3fae6a | Current navigation item marker, unread mail marker. |
brand-deep | #1c6b3d | #8fd4a8 | Text on brand-soft (5.6:1 light, 8.2:1 dark). |
brand-soft | #e2f2e8 | #17301f | Current navigation item background. |
focus | #1f8a4c | #3fae6a | The focus ring (4.4:1 light, 6.3:1 dark on surface). |
danger / on-danger | #b42318 / white | #ff8a80 / #16161b | Buttons that remove or stop. |
paper | #f6f1e1 | #1a2a24 | The sign-in page's background. |
chart | #3fae6a | #5cc486 | 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 at least 4.7:1 in both schemes). They are the suite's tones, the same in all three apps:
| Tone | Light (text / soft) | Dark (text / soft) | Means |
|---|---|---|---|
ok | #157a43 / #e3f4ea | #6fd39a / #13301f | Done, working: active, delivered, enabled. |
warn | #8a5300 / #fff1d6 | #f5c26b / #33260e | Waiting or needs attention: held mail, over quota, starred. |
bad | #b42318 / #fde8e6 | #ff8a80 / #3a1715 | Failed or refused; errors. |
info | #2d47a0 / #e6ecfa | #a9bcf5 / #1b2442 | Neutral events: pending, changed. |
neutral | #4a5063 / #edeff3 | #b4b9c8 / #252833 | Not started, disabled or over. |
violet | #6941c6 / #f0ebfc | #c4b0f5 / #2a2142 | Deliberately not delivered. |
Green is the brand's colour, and a state colour too (ok), so the brand green
is never used for a state and no state uses brand: the current navigation
item and an unread message are marked by the brand tint and bar, a state by
its badge with words.
Typography
- Nunito (SIL Open Font License;
priv/static/fonts/nunito-latin.woff2, a Latin subset of the variable font; licence inpriv/static/fonts/OFL.txt) for the wordmark and for headings (h1–h3, throughfont-display). - The system's UI font (
font-sans) for everything else, with tabular figures on for the whole page. - The system's monospace font (
font-mono) for values that are copied or compared character by character: addresses in tables, ids, keys, app passwords.
Scale (rem at a 16 px root; the body is 14 px):
| Role | Size | Weight |
|---|---|---|
Page title (<.header>) | 20 px, 24 px from sm | 600 |
Panel title (<.panel title>) | 15 px | 600 |
| Body, tables, inputs | 14 px | 400 |
| Message text | 15 px, line height 1.6, at most 70 characters wide (.kt-measure) | 400 |
| Secondary text, help, captions | 13 px | 400, text-muted |
| Table headings, badges | 12 px | 500 |
| Wordmark | 22 px (sidebar), 48–60 px (sign-in) | 800 |
Text is set in sentence case. No all-capitals labels.
Space, size and density
- A 4 px grid. Page gutters 16 px on phones, 24 px from
sm, 32 px fromlg; content at most 72 rem wide, except the mail pages (wide). - Between panels 24 px; inside a panel 16 px; a form's fields 12–20 px apart.
- Reading pages (mail, calendar, tasks, contacts) use rows 10–12 px high; admin tables are dense: cells 12 × 8 px, one line where possible, no striping, a row highlights on hover.
- Controls are 36 px high, 28 px for small buttons in tables and toolbars. Click targets are at least 24 × 24 px (WCAG 2.2, 2.5.8).
- Corners: 6 px for controls, 8 px for panels and lists, 12 px for the sign-in card; badges are pills.
Layout
The signed-in pages share one shell, KantoorWeb.Layouts.app/1:
┌ledger band (green and ink rules, yellow tab)────────────────────────┐
│ [lora] Kantoor │ EN / NL ann@… ▾ │
│ ├────────────────────────────────────────────────────┤
│ ▢ Mail │ Page title [actions] │
│ ▢ Calendar │ │
│ ▢ Tasks │ ┌panel──────────────────────────────────────────┐ │
│ ▢ Contacts │ │ … │ │
│ ▢ Settings │ └───────────────────────────────────────────────┘ │
│ ▢ Admin │ │
└──────────────────┴────────────────────────────────────────────────────┘- Sidebar (16 rem): the lockup, then the areas: Mail, Calendar, Tasks,
Contacts, Settings (with App passwords and Sharing under it while in it) and,
for administrators, Admin. The current area has a brand-green bar on the left,
a
brand-softbackground andaria-current="page". - Top bar: the language switch (EN / NL) and the user menu (the address,
Sign out). The user menu is a
<details>, so it needs no script. - Mail is one LiveView (
KantoorWeb.Mail.InboxLive) for the folders, the list and the open message. From 1280 px (xl) it is three panes beside each other: folders (14 rem), the message list (20 to 26 rem) and the message in a reading column; with no message open the third pane says to choose one. Between 1024 and 1280 px the folders and the list are shown, and a message opens alone. The list keeps its own scroll position; an open message is marked in the list by a green bar onbrand-soft. A message has its own shareable URL (/mail/:mailbox_id/messages/:id), and moving between messages is a live patch, so the list, its scroll position and the selection stay as they are. The open message is the LiveComponentKantoorWeb.Mail.MessagePane; it tells the page (by messages to the LiveView) to flash, to close, or to leave. A row is the sender and the time, then the subject, then one line of the body; unread mail is bold with a green marker, and the star sits at the right. Folder names are shown in sentence case ("Inbox"); the protocol names are unchanged. Unread messages have a green bar and bold text; read ones are quieter. - Phones (below 1024 px): the sidebar is a drawer opened by the menu button;
it is a visually hidden checkbox and a label, so it opens without script and
works with the keyboard; a few lines of
app.jsadd Escape to close it (and the user menu). The mail page is the exception: its own compact bar (menu, folder, search) replaces the site header, the folders are a drawer opened by its menu button, and the list starts under the bar. A row's avatar (or a long press on the row) starts a selection; the bar then becomes the selection bar, and there is none while nothing is selected. Compose is a floating button. On a touch screen a row swipes left to delete and right to archive. Bar buttons are 44 × 44 px on a phone. Below 1280 px the mail panes show one at a time, and a message opens alone with Back (hidden at 1280 px and wider, where the list is beside it). The layout holds from 360 px wide. - Tables are tables from 768 px; when one is wider than its panel it
scrolls sideways inside the panel (the page never does). Below 768 px every
row is a card, so nothing scrolls sideways: the identity column is the card's
heading in full, status columns are badges beside it, the key numbers sit on
one line, secondary fields are behind a small More details text
disclosure, and the common action sits beside a ⋯ menu (a native popover,
no script) that holds the rest. Targets are 44 px. See
<.table>below. - The page before sign-in (
Layouts.auth/1): the band, the mark large and the name on paper, one card 24 rem wide.
Components
All in KantoorWeb.CoreComponents unless noted. A page uses these and adds
layout utilities (grid, flex, gap, widths) only.
| 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> | A list of records: a table from 768 px, a compact card per row below it. Mark the identity column mobile={:title}, a status mobile={:badge}, a secondary field mobile={:detail}, a desktop-only column mobile={:hidden}; the rest are inline label/value pairs. Put the key numbers in :summary, the common action in :primary_action, the rest (destructive in red) in :action, which opens from a ⋯ menu. Slots receive {row, layer}; use layer_id/2 for ids so the table and card copies stay unique. |
<.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. |
<.callout> | A notice in the page by tone: a failed read, a held-mail warning, a secret shown once. |
<.stat> | A number to take in at a glance, with its label. |
<.button> | Actions; a link when it navigates. primary once per form or page, plain for the rest (a text action such as Star, Mark unread or Add Bcc is plain), ghost and danger_ghost only for icon buttons, Back and Cancel, danger for what removes, ok and warn for an answer with a tone. size="sm" or "xs" in tables and toolbars; join and active for a segmented control (Month / Week). |
<.input> | Every form field: label above, errors below. |
<.badge> | A short label by tone: ok, warn, bad, info, neutral, violet. |
<.flash> | The result of an action, top right; errors are role="alert". |
<.copyable> | A value to copy: monospace, broken anywhere, selected in one click. |
<.icon> | Heroicons, decorative (aria-hidden). |
Layouts.logo/1 | The mascot, its height from class. |
Inputs, selects, textareas, tables and progress bars are styled as native
elements in the base layer of assets/css/app.css (from the tokens), so a page
needs no class for the common case; a size is a utility (h-7). There are no
other component classes in the stylesheet: everything else is a component or
Tailwind utilities.
Writing
- Name things as an ordinary user would: mailbox, folder, message, calendar, task, contact. Administrators' pages say domain, mailbox, quota, held mail.
- Buttons say what happens: "Send", "Save draft", "Move to…"; the flash after it says it happened. An action keeps its name through the whole flow.
- Errors say what is wrong and what to do; an empty list says what will appear and how to make it appear. Errors do not apologise.
- Times are shown in UTC unless the page says otherwise; sizes in bytes, KB and MB.
- Every string goes through Gettext (English and Dutch). Dutch addresses the reader formally ("uw").
Accessibility
The target is WCAG 2.2 AA.
- Contrast: text at least 4.5:1, large text and UI parts (input borders, the focus ring, icons that carry meaning) at least 3:1, in both schemes (the tables above were checked).
- Keyboard: everything works with the keyboard in reading order. "Skip to the
content" is the first thing on every signed-in page; the focus ring (2 px, the
focustoken, 2 px offset) shows on:focus-visibleonly. The phone menu is a checkbox, so the space bar opens it and Escape closes it. - Structure: one
h1per page,h2per panel; landmarks (nav"Main" and "Areas",main); tables withth scope="col"; every input with a label; a field's errors right under it. - State is never colour alone: a badge carries words. Icons are decorative and
icon-only buttons have an
aria-label. - Motion: only transitions that answer an action (a flash appearing) or a
change (the highlight of a row a live page updated); with
prefers-reduced-motion: reducethere is none. - Zoom to 200 % and windows from 360 px wide work without sideways page scrolling; tables scroll inside their panel.
The content security policy
No style attribute and no <style> element in templates or components: sizes,
positions and colours are classes. No inline <script> and no on…
attributes. The only browser code is app.js (LiveView). Fonts and images come
from Kantoor itself (/fonts, /images). A message's HTML is shown in a
sandboxed frame with its own stricter policy (see the webmail pipeline in the
router); 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.
Navigation in the phone mail drawer
The compact mail bar hides the main header below 1024 px. Its drawer therefore
places Apps above the mailboxes, using Layouts.navigation/1 for the same
destinations, Gettext labels and permission checks as the main sidebar. A Kantoor
logo links home and Switch application uses the existing permitted-apps
component. Home is also available in the main phone menu. Drawer links, menu
controls and message/compose return links have targets of at least 44 px; the
existing colour tokens cover both schemes. Desktop navigation stays unchanged.
Mail selection and folder menus
KantoorWeb.MailBulkComponents shares the folder menu and selection bar between
phone and desktop. The bar keeps a visible Select all and a count announced with
role="status"; less common actions are in the overflow. A separate banner
explains page selection versus the entire folder or search. Folder and overflow
menu targets are 44 px in both themes. Escape closes a menu and returns focus to
its trigger. Permanent deletion uses a focused, labelled confirmation with Cancel
first. Large operations announce batch progress and refresh unread counts.