# Working-surface patterns The pages in this kit are rendered by the catalogue's standard layout, where everything a page can hold comes from Markdown. Two layouts in the catalogue go further: `pocket-ops`, the phone-first app surface (installable, works offline), and `intranet`, the records-and-lists surface for signed-in staff. Each adds a small vocabulary of classes that authors write as HTML inside their Markdown, and a theme for either layout styles that vocabulary as well as everything in `specimen.html`. A theme for these layouts is made differently from a theme for the standard layout. Both ship their pattern rules with the theme, and a new theme starts as a copy of a shipped one (`lab` or `control` for `pocket-ops`, `intranet` for `intranet`): the design changes `theme.json` and the short names at the top of `main.css`, and the pattern rules stay. Where a treatment needs a new class, say so in `NOTES.md`; the vocabulary is the layout's, and a class added by one theme is lost when the site switches to another. ## pocket-ops `patterns.css` is in the theme folder and uses only the theme's short names, never a colour value, so the theme controls the look of every pattern through those names. The names that change a pattern's shape and lettering, beyond the colours and fonts: | Short name | What it changes | |------------|-----------------| | `--radius-pill`, `--dot-radius`, `--avatar-radius` | Chips, state badges and progress bars; the dot in a badge and step numbers; avatars (`999px` and `50%` round, `0` square) | | `--label-case`, `--label-track` | Table headings, tile labels and small headings (`none, 0` or `uppercase, .08em`) | | `--button-case`, `--button-track` | Link-buttons drawn by app sheets | | `--figure-font` | Totals, hours, tile values and time cells: the body font, or the mono face | | `--signal` | Live and "now" marks | | `--panel-rule` | The top edge of a panel: leave undefined for a plain edge, `2px solid var(--accent)` for a signal edge, `none` for no edge | The patterns, by class: | Class | Pattern | |-------|---------| | `.po-note` (`.ok .warn .bad .info`), `.po-signed-out`, `.po-msg` | Notes | | `.po-badge`, `.po-state` (`data-state` `ok` `attention` `pending` `off`) | Status badges and state chips | | `.po-tiles`, `.po-tile`, `.po-label`, `.po-figure`, `.po-trend` | KPI tiles | | `.po-chips` | Filter chips (scroll inside their own row) | | `.po-table-wrap` and `.po-table` (`.po-stack` for cards on a phone) | Data tables | | `.po-form`, `.po-row`, `.po-fieldset`, `.po-check`, `.po-filter` | Fields and choices | | `.po-fields`, `.po-totals`, `.po-notes`, `.po-stars`, `.po-split` | Record details | | `.po-apps` | App cards (the whole card is the link) | | `.po-banner` (`-warning -info -danger`), `.po-waiting` | The connection banner and the waiting list | | `[data-ls-odoo-prompt]` | The sign-in dialog | | `[data-ls-app-banner]`, `[data-ls-app-show-out]`, `[data-ls-app-status]` | The app slots (`STATES.md`, "App slots") | ### KPI tiles A row of figures: a label, the figure in `--figure-font`, and, if wanted, a trend line. The row fills the width in tiles at least 11rem wide and keeps two to a row under 30rem. A tile that is a link (`a.po-tile`) is at least 44px high and takes the hover well. ```html ``` `data-trend="up"` colours the trend line with `--ok` and `"down"` with `--bad`; without it the line is muted. The trend says the direction in words, so colour is never alone. ### State chips `.po-state` is a word with a mark. Without `data-state` it is neutral with a dot. `data-state` gives it a tone from the theme's status names and a mark of its own shape, so the states differ without colour as well as by word, in both schemes. | `data-state` | Colour | Mark | Use for | |--------------|--------|------|---------| | `ok` | `--ok` | tick | Done, settled, in order | | `attention` | `--warn` | triangle | Held, late, needs a person | | `pending` | `--info` | ring | In hand, waiting to send, in progress | | `off` | `--muted` | dash | Not started, paused, switched off | ```html Done Held ``` An unknown value stays neutral. ## intranet The theme's `main.css` carries the `in-` rules. A second theme for this layout is a token file and nothing else. | Class | For | |-------|-----| | `in-panel` | A bordered surface for one unit of content. A heading first inside it sits flush. | | `in-cards` | A grid of panels that wraps from several columns to one. | | `in-callout` | The "why you are looking at this record" note: a warm rule on a warm tint. | | `in-chip` | A status mark, uppercase, with the word in it so colour is never the only signal. | | `in-is-active`, `in-is-attention`, `in-is-settled`, `in-is-current` | The row and mark states, one set for chips, table rows, list items and checklist items. | | `in-num` | A table cell for a quantity: right-aligned, tabular figures, no wrapping. | | `in-tight` | A table column that takes only the room it needs. | | `in-sticky` | On a table: a long list keeps its header row in view. | | `in-files` | On a table: a file list, with the name column in monospace and the size column on the right. | | `in-checklist` | On a list: a box before each item, a tick and a strike on the settled ones. | | `in-actions` | An action bar, right-aligned with a hairline above. The destructive button is written first and the primary last: the danger button is far left on a wide screen and on a row of its own under 30em; the primary is last at any width. | | `in-button` | A quiet outline button on a link or a `div`; a `button` element already has it. | | `in-button-primary`, `in-button-danger` | The one primary action, and the destructive one. | | `in-empty` | An empty state: a sentence a person would say. | The four states read as: | State | Reads as | |-------|----------| | neutral | No class. A grey chip: not started, nothing to say. | | `in-is-active` | Accent on a pale tint: yours, current, selected. | | `in-is-attention` | Warm: held by somebody else, over-allocated, a problem. | | `in-is-settled` | Green: answered, complete, matched. | | `in-is-current` | A 3px accent bar on the first cell of a row, or along the left edge of a checklist item, the full height of the row and down to its rule: the one being looked at. A checklist item's box starts clear of the bar. | ```html
TaskOwnerStateHours
Reconcile MarchAshaIn hand6.5
Supplier queriesDevHeld12
Withdraw Cancel
``` What needs no class in `intranet`: Markdown tables (a right-aligned `---:` column takes the quantity treatment), definition lists, task lists, blockquotes, `details`, and the engine's forms with every `.form-*` class, their messages and steps. ## The check `lzs-design-kit.sh check` reads `layouts` in `theme.json`. For a theme that lists `pocket-ops` it warns when `.po-tile`, `.po-state[data-state` or `.po-banner` have no rule; for one that lists `intranet` it warns when `.in-chip`, `.in-is-current` or `.in-actions` have none. Those rules normally arrive with the copied theme, so a warning means the copy lost them.