Tabs & Spaces Developers

Build

Design language

Your tab or home page fills a panel inside the workspace, beside its own tabs. When it uses the same colours, type, spacing and parts, people read it as part of their workspace, not something bolted on. This page sets out how the workspace looks, and gives you a stylesheet with all of it.

The Studio requests tab in a space, built with the stylesheet: a title with a New request button, three numbers, a segmented control, and a list of requests with their status.
A tab built with the stylesheet, beside the workspace's own tabs.

Use the stylesheet

The workspace's look comes as a stylesheet with its fonts and icons: the same files as the workspace's own, so its colours, type and spacing are the app's. Where you get it depends on where your page lives.

A tab without a server (or one an agent builds): the workspace serves it beside your files, as tands-design/, so there's nothing to copy, and it's always the deployment's own. Link it:

html
<link rel="stylesheet" href="tands-design/tabs-and-spaces.css" />

A page on your own server: it's in @tabs-and-spaces/sdk, in design/. With a bundler, import it; otherwise copy the folder beside your page and link it as above. tands new copies it in for you.

js
import "@tabs-and-spaces/sdk/design/tabs-and-spaces.css";

Or download it: tabs-and-spaces.css, with the fonts it loads from fonts/ beside it and icons.js. The version it comes from is in its first line.

It has four parts:

PartWhat it is
FontsInter, as the workspace uses it (SIL Open Font License 1.1, in fonts/OFL.txt). Without the files, your page uses the device's own sans-serif
TokensEvery colour, size, space, radius, shadow and timing as a CSS variable, in light and dark: var(--color-text), var(--space-4), var(--radius-md)
Base stylesA small reset: the page's background, text, font and line height, headings, links, focus rings, and no motion for those who ask for less
PartsButtons, fields, choices, cards, rows, lists, numbers, tables, badges, notices, menus, dialogs, icons and empty states, as classes starting ts-, so they never clash with yours (below)

Use the tokens even where you don't use the parts. A colour written as var(--color-text-muted) stays right in both themes and with the workspace's accent; one written as #666 doesn't.

Follow the workspace

The tokens follow data-theme on <html> (light or dark; without it, the device's), and the workspace's own colours when they're set on it. Connect with applyTheme, and the SDK does both, and keeps them up to date as the reader switches theme or the workspace changes its accent:

js
const tands = await connect({ applyTheme: true });

To do it yourself, tands.theme and tands.styles (the colours, as CSS variables) say what they are now, and onTheme((theme, styles) => …) when they change. See the SDK.

Principles

  • Content first, chrome last. The interface recedes; people's work comes forward. No decoration that doesn't help someone read or act.
  • Almost all black and white. Warm neutrals, like paper and stone, not screen grey. Hierarchy comes from contrast, weight, size and space, not from hue.
  • Colour means something. It's kept for a few moments: something failed or can't be undone (danger), something worked (success), something new arrived, a chart's series, and the workspace's own accent.
  • Type does the work. One sans-serif, a tight scale, semibold for titles, medium for labels, regular for reading.
  • A strict rhythm. Spaces on a 4 px grid, a few radii, hairline borders used sparingly.
  • Quiet motion. Short, purposeful transitions; none at all for those who ask for less.
  • Light and dark are equals. Every screen is designed in both.
  • Accessible by default. Text passes WCAG AA in both themes, focus is always visible, and nothing is said by colour alone.

What it is not: gradients, glows, emoji confetti, sparkle icons, a card around every paragraph, or a colour for every category.

Colour

Each swatch shows light on the left and dark on the right. A page uses the token, never the value, so it follows the theme.

Surfaces

TokenLight · darkFor
--color-canvas#ffffff · #151514Your page's background: the panel tabs sit in
--color-surface#f7f6f3 · #1b1b19Quiet fills: number tiles, wells, a code block
--color-surface-raised#ffffff · #222220Things raised above the page: fields, menus, a chosen option
--color-backdrop#f3f2ef · #0b0b0aThe app's frame, around the panel; rarely yours

Hover and pressed states darken whatever is under them, in both themes: --color-hover for a hover, --color-active for something pressed or chosen.

Lines

TokenLight · darkFor
--color-border#ebe9e4 · #262624Hairlines: cards, lists, between rows
--color-border-strong#dcd9d2 · #353532Fields, and lines that must be seen

Borders are always var(--border-width): 1 px.

Text

TokenLight · darkFor
--color-text#1a1917 · #edece8Everything people read first
--color-text-muted#57544e · #aeaca6Details under a name, descriptions, quiet labels
--color-text-subtle#6b6862 · #8f8d87Hints, placeholders, times, counts

All three pass WCAG AA on the canvas, the surface and the backdrop. Don't go lighter.

Emphasis and status

TokenLight · darkFor
--color-accent#1a1917 · #edece8The main action, a switch that's on, what's chosen. Ink by default
--color-on-accent#ffffff · #151514Text on the accent
--color-danger#b42318 · #f97066Errors, and actions that can't be undone
--color-success#1f7a4d · #47cd89Done, connected, saved
--color-notify#c26a12 · #f0a54aSomething new arrived

--color-accent-hover and --color-focus-ring go with them. Focus rings and a field's glow are drawn with var(--color-focus-ring) and var(--ring).

The workspace's accent

A workspace may choose its own accent (in Workspace settings → General); the app's buttons, switches, focus rings and what's new then take that colour. Your page is told it too, as --color-accent, --color-accent-hover, --color-on-accent, --color-focus-ring and --color-notify for the theme it's in, and with applyTheme they're set on your page. So use --color-accent for what the app uses it for (the main action, what's chosen), and your page takes the workspace's colour with the rest. Without an accent, it's the default ink.

The Studio requests tab in a workspace with a teal accent: its New request button and New badge are teal, like the workspace's own.
The same tab, in a workspace with a teal accent: it follows, with no change to the tab.

Charts

The one place hue carries meaning: a chart's series, always in this order, never cycled. A seventh series goes into "Other".

TokenLight · dark
--color-chart-1#2a78d6 · #3987e5
--color-chart-2#eb6834 · #d95926
--color-chart-3#1baf7a · #199e70
--color-chart-4#eda100 · #c98500
--color-chart-5#e87ba4 · #d55181
--color-chart-6#008300 · #008300

Some of these are lighter than text should be, so a chart always has a legend (or its series named beside their lines) and a way to see its numbers as a table. One axis only: two measures of different sizes are two charts. In an agent's answer, a chart card does all this for you.

Type

TokenSizeFor
--text-xs12 pxBadges, counts, small print
--text-sm13 pxLabels, details, hints, secondary buttons
--text-md14 pxThe base: body text, buttons, fields
--text-lg16 pxReading text, a card's title
--text-xl20 pxA tab's title
--text-2xl24 pxA number at a glance
--text-3xl32 pxA home page's welcome
--text-4xl44 pxRarely: one large figure
  • Weights: --weight-regular (400) to read, --weight-medium (500) for labels, names and buttons, --weight-semibold (600) for titles. Nothing bolder.
  • Headings are semibold, with tight line height (--leading-tight) and letters drawn in (--tracking-tight). The base styles do this for h1 to h4.
  • Line height: --leading-normal (1.5) for text, --leading-snug (1.35) for short lines in small sizes.
  • Sentence case everywhere: titles, buttons, tabs. Never all capitals.
  • Numbers that line up or change in place use font-variant-numeric: tabular-nums.
  • Code is in --font-mono.

Space and shape

Every gap and padding is on a 4 px grid:

TokenSize
--space-0-5, --space-1, --space-1-52, 4, 6 px
--space-2, --space-3, --space-48, 12, 16 px
--space-5, --space-6, --space-820, 24, 32 px
--space-10, --space-12, --space-1640, 48, 64 px

A few radii, by size: --radius-sm (6 px) for small controls, --radius-md (9 px) for buttons and fields, --radius-lg (14 px) for cards and lists, --radius-xl (18 px) for large panels, and --radius-full for pills, dots and avatars.

Controls are --control-height-md (36 px) tall, or --control-height-sm (30 px) in tight rows.

Shadows are warm and layered, and lean on a hairline in dark mode: --shadow-xs for raised controls, --shadow-sm for small cards, --shadow-panel for panels, --shadow-popover for menus and dialogs. Most cards need none: a hairline is enough.

Motion

TokenTimeFor
--duration-fast120 msHover, press, a colour changing
--duration-base200 msA switch moving, a panel opening
--duration-slow320 msLarger moves

Ease out with --ease-out; move and back with --ease-in-out. The durations become zero for people who ask their device for less motion, and the base styles stop animations for them too.

Parts

Each part below is drawn by the stylesheet, as you see it here. Copy the markup and fill it in.

Buttons

One main action per view, in ink; everything else raised paper, or quiet in a row. Red only for what can't be undone.

html
<button class="ts-button" type="button">New request</button>
<button class="ts-button" type="button" data-variant="secondary">Export</button>
<button class="ts-button" type="button" data-variant="ghost">Cancel</button>
<button class="ts-button" type="button" data-variant="danger">Delete for good</button>
<button class="ts-button" type="button" data-variant="secondary" data-size="sm">Small</button>

A button says what it does: Save request, not Submit or OK.

Fields

A label above, a hint or error below. Mark a wrong value with aria-invalid="true" and say why.

html
<label class="ts-field">
  <span class="ts-label">Client</span>
  <input class="ts-input" placeholder="Harbour Café" />
  <span class="ts-hint">Who asked for it.</span>
</label>
<textarea class="ts-input"></textarea>

Choices

A segmented control for two to five views or options, a switch for something that takes effect at once, and a select for longer lists.

html
<div class="ts-segmented" role="radiogroup" aria-label="Show">
  <label><input type="radio" name="show" checked /><span>Open</span></label>
  <label><input type="radio" name="show" /><span>Done</span></label>
</div>

<button
  class="ts-switch"
  type="button"
  role="switch"
  aria-checked="true"
  aria-label="Email me"
></button>

<span class="ts-select">
  <select aria-label="Sort">
    <option>Newest first</option>
    <option>Due soonest</option>
  </select>
</span>

A switch's aria-checked is yours to turn: flip it on click.

Cards and rows

Settings and details sit in a card with hairlines between rows: what it is on the left, its control on the right. On a phone the control goes underneath.

Email me new requests At most one email an hour.
Due in For new requests.
html
<div class="ts-card">
  <div class="ts-row">
    <div class="ts-row-text">
      <span class="ts-row-label">Email me new requests</span>
      <span class="ts-row-hint">At most one email an hour.</span>
    </div>
    <button
      class="ts-switch"
      type="button"
      role="switch"
      aria-checked="false"
      aria-label="Email me new requests"
    ></button>
  </div>
</div>

For free-form content in a card, use <div class="ts-pad">.

Lists

Things in a list: a name, a line of detail, and their state at the end.

  • New menu photosHarbour Café · due Thursday Open
  • Logo in two coloursWillow & Pine · due today Overdue
  • Spring newsletterFernhill Books Done
html
<ul class="ts-list">
  <li>
    <span class="ts-item-text">
      <span class="ts-item-name">New menu photos</span>
      <span class="ts-item-detail">Harbour Café · due Thursday</span>
    </span>
    <span class="ts-badge">Open</span>
  </li>
</ul>

Numbers at a glance

12Open
3Due this week
48Done this month
html
<div class="ts-stats">
  <div class="ts-stat"><strong>12</strong><span>Open</span></div>
  <div class="ts-stat"><strong>3</strong><span>Due this week</span></div>
</div>

Status

A badge names a state in a word; data-tone adds colour to the word, never in place of it. A dot sits beside a word, and a notice says something to read before going on.

Waiting Done Overdue New Connected

Requests from clients arrive here when they email the studio.

The client's site couldn't be reached. Try again in a minute.

html
<span class="ts-badge" data-tone="success">Done</span>
<span class="ts-dot" data-tone="success"></span>
<p class="ts-notice" data-tone="danger">
  The client's site couldn't be reached. Try again in a minute.
</p>

Tables

Rows of figures: in a hairline box that scrolls sideways on its own. Figures line up on the right (data-align="end").

ClientRequestsHours
Harbour Café512.5
Willow & Pine38.0
Fernhill Books23.5
html
<div class="ts-table-wrap">
  <table class="ts-table">
    <thead>
      <tr>
        <th>Client</th>
        <th data-align="end">Hours</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>Harbour Café</td>
        <td data-align="end">12.5</td>
      </tr>
    </tbody>
  </table>
</div>

A menu is a native popover: a button opens it with popovertarget, and its items close it with popovertargetaction="hide" (or do something first, in a click handler). It opens under its button where the browser can place it, and in the middle of the page where it can't. Escape and a click outside close it.

Call menus() once, from menus.js beside the stylesheet (or @tabs-and-spaces/sdk/design/menus), and they move as the workspace's do: opening one puts focus on its first item, ↓ and ↑ move between items (round the ends, past disabled ones), Home and End go to the first and last, and Tab closes it.

js
import { menus } from "./tands-design/menus.js";
menus();
Request
html
<button class="ts-button" type="button" data-variant="secondary" popovertarget="more">More</button>
<div class="ts-menu" id="more" popover>
  <span class="ts-menu-label">Request</span>
  <button class="ts-menu-item" type="button" popovertarget="more" popovertargetaction="hide">
    Rename
  </button>
  <div class="ts-menu-separator"></div>
  <button
    class="ts-menu-item"
    type="button"
    data-tone="danger"
    popovertarget="more"
    popovertargetaction="hide"
  >
    Delete
  </button>
</div>

aria-checked="true" on an item ticks it (a choice, like a sort order).

Dialogs

A dialog is a native <dialog>, opened with showModal(): the page behind waits, Escape closes it, and a <form method="dialog"> inside closes it with its buttons. On a phone it comes up from the bottom.

Delete this request?

Logo files in two colours, for Willow & Pine. It can't be brought back.

html
<dialog class="ts-dialog" id="confirm">
  <div>
    <h2 class="ts-dialog-title">Delete this request?</h2>
    <p class="ts-dialog-description">It can't be brought back.</p>
  </div>
  <form method="dialog" class="ts-dialog-footer">
    <button class="ts-button" data-variant="secondary" value="cancel">Cancel</button>
    <button class="ts-button" data-variant="danger" value="delete">Delete request</button>
  </form>
</dialog>
<script type="module">
  const dialog = document.getElementById("confirm");
  dialog.showModal();
  dialog.addEventListener("close", () => console.log(dialog.returnValue)); // "delete" or "cancel"
</script>

data-size="sm" or "lg" makes it narrower or wider.

Nothing yet

When there's nothing to show, say so plainly and offer the way forward.

No requests yet. They'll appear here as clients send them.

html
<div class="ts-empty">
  <p>No requests yet. They'll appear here as clients send them.</p>
  <button class="ts-button" type="button" data-variant="secondary">Add one yourself</button>
</div>

Laying out a page

  • Your page is the panel. Its background is --color-canvas; don't draw a frame, a shadow or a title bar around it. The workspace already shows the tab's name above it.
  • Start with what's in view, not the tab's name again: a short title, and the main action on the right (ts-header, ts-title). Pad the page by 24 px, or 16 px on a phone (ts-page).
  • Fill the width with lists, boards and tables, but keep reading text to about 46rem.
  • Design for any size, down to a phone's 390 px: rows stack, numbers wrap, nothing scrolls sideways.
  • Group with space and hairlines before boxes. A card is for a group of settings or one object's details, not for every paragraph.
  • A home page has no tab row around it. A welcome in --text-3xl and a few clear sections suit it.
html
<body>
  <main class="ts-page">
    <header class="ts-header">
      <div>
        <h1 class="ts-title">Requests</h1>
        <p class="ts-muted">12 open in Client work</p>
      </div>
      <button class="ts-button" type="button">New request</button>
    </header>
    <!-- … -->
  </main>
</body>

Icons

The workspace draws its icons with Lucide (free, under the ISC licence): outlined, round-ended strokes 2 px wide, at 14 to 16 px beside text and 17 px in navigation, in currentColor so they take the text's colour. The ones it uses most come with the stylesheet, in icons.js (beside it, or @tabs-and-spaces/sdk/design/icons):

js
import { icon, renderIcons } from "./tands-design/icons.js";

button.innerHTML = `${icon("plus")} New request`;
renderIcons(); // draws every <span data-icon="plus"></span> on the page

An icon sits beside a word; on its own it's a ts-icon-button with a name (aria-label) and a tooltip (title), or icon(name, { label }). No filled, coloured or emoji icons. For one that isn't there, use Lucide's own, drawn the same way.

Words

How the workspace speaks matters as much as how it looks:

  • Plain and short. Saved., Couldn't save. Try again., No requests yet.
  • Sentence case, and no full stop on a button or a title.
  • Say what happened and what to do next. Never just Error, and never blame the reader.
  • Name things as the workspace does: spaces, tabs, tasks, agents, members, guests.
  • No exclamation marks, no emoji, no "Oops".
  • In the reader's language. tands.context.locale says which; format dates and numbers with Intl in it. The workspace's English is British: colour, organise, cancelled.

Accessibility

  • Keep to the text tokens: they pass WCAG AA in both themes.
  • Keep focus visible: the base styles draw --color-focus-ring around whatever has keyboard focus. Don't remove it.
  • Everything works with a keyboard: real <button>s and <input>s, not clickable <div>s.
  • Every field has a label; every icon-only button a name.
  • State is in words (a badge, a label), with colour only as a help.
  • Motion respects the reader's setting; the stylesheet does that for its own.

Before you publish

  • It looks right in light and in dark, and changes when the reader switches while it's open.
  • It works at 390 px wide, with nothing scrolling sideways.
  • Every colour is a token; there are no greys of your own.
  • There's one main action in view, and it says what it does.
  • It works with only a keyboard, with focus always visible.
  • Empty, loading and error states say something useful.
  • Its words are in the reader's language, in sentence case.

Search every page: actions, the manifest, the SDK, tokens…