@alis-build/design-system 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +7 -0
  3. package/README.md +33 -2
  4. package/alisx.css +586 -0
  5. package/assets/Brand/README.md +9 -0
  6. package/assets/Brand/alis-exchange-icon.png +0 -0
  7. package/assets/Brand/alis.svg +13 -0
  8. package/assets/Brand/alis_build.svg +31 -0
  9. package/assets/Brand/alis_exchange.svg +19 -0
  10. package/assets/Brand/alis_ideate.png +0 -0
  11. package/assets/Brand/alis_ideate.svg +31 -0
  12. package/assets/Brand/alis_primary_logo.png +0 -0
  13. package/assets/Brand/favicon.svg +17 -0
  14. package/components/AlisMark.md +34 -0
  15. package/components/AppAlert.md +56 -0
  16. package/components/AppButton.md +63 -0
  17. package/components/AppCard.md +54 -0
  18. package/components/AppChip.md +75 -0
  19. package/components/AppDialog.md +42 -0
  20. package/components/AppEmptyState.md +51 -0
  21. package/components/AppIcon.md +51 -0
  22. package/components/AppIconButton.md +44 -0
  23. package/components/AppLattice.md +53 -0
  24. package/components/AppListRow.md +69 -0
  25. package/components/AppLoader.md +44 -0
  26. package/components/AppProgress.md +50 -0
  27. package/components/AppSegmented.md +36 -0
  28. package/components/AppSelect.md +59 -0
  29. package/components/AppSelectTile.md +45 -0
  30. package/components/AppShell.md +66 -0
  31. package/components/AppSkeleton.md +51 -0
  32. package/components/AppSwitch.md +39 -0
  33. package/components/AppTable.md +63 -0
  34. package/components/AppTextField.md +83 -0
  35. package/components/AppTitleBar.md +85 -0
  36. package/components/CapabilityMark.md +63 -0
  37. package/components/README.md +121 -0
  38. package/fonts.css +4 -0
  39. package/marks.json +57 -0
  40. package/package.json +31 -4
  41. package/rules/README.md +68 -0
  42. package/rules/anti-patterns.md +68 -0
  43. package/rules/buttons.md +121 -0
  44. package/rules/chips-alerts.md +77 -0
  45. package/rules/colour.md +99 -0
  46. package/rules/icons.md +65 -0
  47. package/rules/known-gaps.md +34 -0
  48. package/rules/loading.md +71 -0
  49. package/rules/page.md +155 -0
  50. package/rules/quick-start.md +125 -0
  51. package/rules/register.md +119 -0
  52. package/rules/selection.md +111 -0
  53. package/rules/spacing.md +88 -0
  54. package/rules/styling.md +83 -0
  55. package/rules/surfaces.md +75 -0
  56. package/rules/type.md +186 -0
  57. package/tokens.json +922 -0
@@ -0,0 +1,125 @@
1
+ # Quick start · build a product screen
2
+
3
+ Everything you need to build a working screen in Ideate, Build or Admin. Use the [rules](README.md) for the reasons, and when something here doesn't decide.
4
+
5
+ ## 1. Load it
6
+
7
+ ```js
8
+ import '@alis-build/design-system/fonts.css' // prototypes only: Google Fonts. Self-host in production.
9
+ import '@alis-build/design-system/alisx.css' // tokens, type classes, product base, .app-* components
10
+ ```
11
+
12
+ Or link the same two files from `node_modules`, or from a CDN at a pinned version. Then write each component's markup from its guide in [components/](../components/README.md): the classes, the ARIA, and the behaviour you supply. That README ends with a finished skeleton of the § 5 screen (a list with a settings pane); start from it rather than blank. The names below (`AppShell`, `AppButton variant="filled"` …) are those components and their variants.
13
+
14
+ ## 2. The skeleton
15
+
16
+ ```
17
+ AppShell product="build"
18
+ ├─ nav AppListRow variant="nav" × destinations (navFoot: Settings, Help)
19
+ ├─ content AppTitleBar name · search · verbs · route tabs
20
+ │ [AppAlert, only for a page-level notice]
21
+ │ .app-shell__content
22
+ │ AppFilterRow "5 environments" ··· AppSegmented / filter AppChips
23
+ │ the list, table or document
24
+ └─ detail (optional) AppTitleBar variant="detail", then the selected thing
25
+ ```
26
+
27
+ ## 3. Which component
28
+
29
+ | You need | Use |
30
+ |---|---|
31
+ | The frame, navigation, product name | `AppShell` (it draws `AppLockup`) |
32
+ | The screen's name, search, verbs | `AppTitleBar`. Verbs are default-size text buttons; no icon on a single verb |
33
+ | The bar of a detail pane | `AppTitleBar variant="detail"`: close, the name in section-title, its verbs on a row below |
34
+ | To narrow one list | `AppFilterRow` + `AppSegmented` (2–5 options) or filter `AppChip`s |
35
+ | A list of things | `.app-list` + `AppListRow`; status as `trailing` small `AppChip kind="status"`; time as `meta`; other facts joined with " · " in `supporting` |
36
+ | Things people compare or sort by their values | `AppTable` |
37
+ | An object you act on | `AppCard variant="instrument"` |
38
+ | Context you don't act on | `AppCard variant="statement"`, or no container at all |
39
+ | Prose you read, a document | `AppLattice`s at the prose measure, `.prose` inside; a quote is a `blockquote` with a `cite` |
40
+ | Questions and answers | `AppTranscript` |
41
+ | Content Alis wrote | a label `AppChip icon="auto_awesome"` "AI-generated", once, at its top |
42
+ | The one action that moves the user forward | `AppButton variant="filled"`, once per surface, labelled with the outcome |
43
+ | Everything else you press | `AppButton` (text), `AppIconButton` |
44
+ | A form | `.app-form` of fields, one filled action last (see § Forms) |
45
+ | Text | `AppTextField` (with `action` for one that collects several values, shown as input `AppChip`s below) |
46
+ | One choice from a list | `AppSelect` |
47
+ | An on/off setting | `AppSwitch` |
48
+ | A choice among cards, labelled | `AppSelectTile`s in an `AppFieldset` |
49
+ | Rendered markdown | `.prose` on the container |
50
+ | A status on a panel | `AppAlert` (the panel is the status) or `AppChip` (the panel has one); states map to tones in [AppChip](../components/AppChip.md) |
51
+ | A result that passes ("Saved", "Deleted") | `AppSnackbar` |
52
+ | A confirmation | `AppDialog` with `onClose`, text actions, affirmative last |
53
+ | Waiting, shape known | `AppSkeleton` in the content's shape |
54
+ | Waiting, shape unknown | `AppLoader` |
55
+ | Work you can count (a deploy, an upload) | `AppProgress`, with `AppSteps` for named stages |
56
+ | Nothing yet | `AppEmptyState` filling the pane; keep the bar's name and verb, hide search and the filter row |
57
+
58
+ ## 4. The values you'll reach for
59
+
60
+ - **Colour**: `primary` (actions only), `on-surface` and `on-surface-variant` (the two inks), `background` / `surface-container-low` / `surface` (ground, statement, instrument), `secondary-container` (selected), `error` `warning` `success` `info`.
61
+ - **Type**: `.text-page-title`, `.text-section-title`, `.text-object-title`, `.text-body`, `.text-supporting`, `.text-meta`, `.text-label`, `.text-eyebrow`. Supporting, meta and eyebrow take `.text-on-surface-variant`. At most three on a surface. `.text-mono` and `.text-emphasis` sit beside a role.
62
+ - **Space**: `space-4` `8` `12` `16` `24` `32` `48`, nothing else. Sections of a pane 24 apart, things within a section 8. **Radius**: `radius-lg` cards and fields, `radius-pill` buttons and chips. **Depth**: `elevation-2` cards, `elevation-3` dialogs.
63
+
64
+ Your own CSS holds layout only: grid, flex, gap, widths. No colours, fonts, borders, radii or shadows ([styling.md](styling.md)). Building something from [known-gaps.md](known-gaps.md) is the one exception, and even then every value is a `var(--…)`.
65
+
66
+ ## 5. A list with a settings pane
67
+
68
+ The screen most product work becomes: a list on the left, the selected item's settings on the right. Everything below is decided.
69
+
70
+ ```
71
+ AppShell product="build" detail={…}
72
+ ├─ content
73
+ │ AppTitleBar title="Environments" search="Search environments"
74
+ │ actions=AppButton "New environment"
75
+ │ .app-shell__content
76
+ │ AppFilterRow summary="5 environments" → AppSegmented All · Healthy · Failed …
77
+ │ .app-list → AppListRow divided title="staging"
78
+ │ supporting="europe-west1 · v1.43.0 · release/1.43"
79
+ │ trailing=AppChip kind="status" tone="error" small "Failed"
80
+ │ meta="3h ago" selected onClick=select
81
+ └─ detail
82
+ AppTitleBar variant="detail" title="staging" leading=AppIconButton close
83
+ actions=[AppButton "Deploy", AppButton tone="error" "Delete"]
84
+ AppAlert tone="error" … only while something is wrong (it stacks here)
85
+ AppProgress steps=[…] only while work runs, or after it failed
86
+ .app-form
87
+ AppTextField "Name"
88
+ AppSelect "Region"
89
+ AppTextField "Branch to deploy"
90
+ AppTextField "Variables" action=AppButton "Add" values=[input AppChips]
91
+ AppSwitch "Deploy on every push" applies with Save, like every field here
92
+ AppButton variant="filled" "Save changes" the pane's one filled button
93
+ ```
94
+
95
+ - **The pane's bar** holds the name in section-title (the screen has the page-title) and the verbs for this thing on their own row, so nothing truncates at 360px.
96
+ - **Save** is the pane's one filled button, last in the form. **Deploy** and **Delete** are verbs, text buttons in the bar.
97
+ - **A long action** (Deploy): the button shows `loading` while the request is accepted; then the bar and steps appear at the top of the pane and the button returns to rest (disabled while the deploy runs). One wait, one indicator. The row's chip says "Deploying" meanwhile.
98
+ - **It fails**: the steps stay, the failed step in `error`, the bar stops in `error`, and an `AppAlert tone="error"` above says what happened and what to do, with one action ("View logs"). The row's chip says "Failed".
99
+ - **It succeeds**: the bar goes, the row's chip says "Healthy", and an `AppSnackbar` says "Deployed v1.43.0".
100
+ - **Delete**: an `AppDialog` titled "Delete staging?", a body saying what goes with it, Cancel then "Delete environment" in `error`. Afterwards the pane closes and a snackbar says "Deleted staging".
101
+ - **View logs** opens the logs where they live (their own screen, outside this system); a prototype links to it.
102
+ - **Deploying to production** is confirmed the same way ("Deploy v1.43.0 to production?"); other environments are not.
103
+ - **Loading** the list: `AppSkeleton` rows in the list's place. **Empty**: `AppEmptyState` in the list's place, with `field={false}` if the detail pane is also empty.
104
+
105
+ ## 6. Forms
106
+
107
+ 1. Validate when the user submits, not as they type. Mark each invalid field (`error="…"` says what to do) and focus the first one through its `ref`.
108
+ 2. Add one `AppAlert tone="error"` at the top only when the failure belongs to no field.
109
+ 3. While it sends, put `loading` on the button they pressed; nothing else changes.
110
+ 4. Confirm what is hard to undo or reaches past the user (sending to people, deleting, deploying to production) in an `AppDialog` that restates it ("Send this interview to 3 people?").
111
+ 5. On success, show the thing that now exists. If the evidence is off-screen or easy to miss, an `AppSnackbar` confirms it ("Saved"); a result someone needs to read gets an `AppAlert tone="success"` at the top.
112
+
113
+ ## 7. Copy
114
+
115
+ Sentence case, British spelling, plain and calm, no dashes, no emoji. Buttons are a verb then the object: **New project**, **Add member**. A filled button names its outcome: "Send the invites", not "Continue". An empty state's headline says why you would act, never the screen's name. An error says what to do next, in a sentence with a full stop. Times are relative and short: "Just now", "5 min ago", "3h ago", "Yesterday", then a date ("3 Oct", three-letter months, with the year only when it isn't this one).
116
+
117
+ ## 8. Before you hand it back
118
+
119
+ 1. Switch off borders and shadows. Can you still see the cards?
120
+ 2. Which button moves me forward? Obvious in one second, and only one is filled?
121
+ 3. More than a couple of bold things? More than three type roles on a surface?
122
+ 4. Any colour, font, radius or shadow in your own CSS?
123
+ 5. A card where spacing would have done? A section nobody asked for?
124
+
125
+ Anything the system didn't cover: [known-gaps.md](known-gaps.md), and say which you hit.
@@ -0,0 +1,119 @@
1
+ # Register
2
+
3
+ Answer this first. Every other rule assumes you have.
4
+
5
+ ```
6
+ What am I building?
7
+ ├─ A screen inside Ideate, Admin or Build: a
8
+ │ shell, thread, table, form, dialog, settings
9
+ │ page → PRODUCT
10
+ ├─ Sign-in, onboarding, an empty state, upgrade → PRODUCT, with the one
11
+ │ crossing below
12
+ ├─ An explainer page inside the product that
13
+ │ sells a capability → EXPRESSIVE (below)
14
+ └─ alisx.com, a landing page, a deck, an email → NARRATIVE
15
+ ```
16
+
17
+ ## Product
18
+
19
+ Material Design 3 is the substrate, and the brand is pulled through it. **Where
20
+ there is no strong contradiction, M3 wins.** Product roles are named as M3 names
21
+ them, so they map onto any M3 implementation.
22
+
23
+ ## The boundary
24
+
25
+ The brand wins on **face, surface, shadow, mark and voice**.
26
+ The product wins on **allocation, accessibility, spacing, icons and status**.
27
+
28
+ These are defects in the product, every time:
29
+
30
+ - The drafting field as app chrome
31
+ - A petrol band as a working surface
32
+ - Four accents: the product has one
33
+ - The narrative radius ladder, or fluid `clamp()` spacing
34
+ - Display weights at body or label size
35
+ - The narrative type scale on a working screen
36
+
37
+ ## The one permitted crossing
38
+
39
+ **Sign-in, onboarding, empty states and upgrade prompts** address the user rather
40
+ than put them to work, so they may use the drafting field and a petrol band
41
+ ([page.md](page.md)). Working screens do not.
42
+
43
+ The test: is the person on this screen **working**, or **being spoken to**? If it
44
+ is genuinely both, it is product with a narrative hero, not a blend.
45
+
46
+ ## Expressive pages
47
+
48
+ An explainer page inside the product may take a bolder treatment:
49
+
50
+ - A drafting-field hero, Nunito Sans 800 display at 64px (48 tablet, 36 phone)
51
+ with tight tracking, and the red terminal mark when the headline has no
52
+ punctuation.
53
+ - Hero copy at 20/32 (18/28 compact) in solid supporting ink, and section
54
+ headings at 36/44 (28/36 phone).
55
+ - Petrol narrative and statistic bands with paired inverse ink, a teal lead
56
+ feature card, and 64px section gaps (48 on a phone).
57
+ - One filled action per hero or closing section; on petrol it is the light filled
58
+ action. Link to destinations and interactions that already exist, rather than
59
+ inventing new ones.
60
+
61
+ The treatment stops at the page's own content. Code, tables, diagnostics, status
62
+ colours and dialogs keep product roles. Never carry the display scale into working
63
+ records or app chrome.
64
+
65
+ ## Narrative
66
+
67
+ alisx.com and everything that addresses a reader. Its tokens are `narrative-*`,
68
+ `band-*`, `on-band-*` and `term-*`; its type is the `narrative-*` and `mono*`
69
+ styles. It never reaches a working screen.
70
+
71
+ ### Voice on alisx.com
72
+
73
+ **Voice.** Declarative, concrete, slightly blunt. Sentences state a fact and stop.
74
+ The page argues by naming a real failure ("Nowhere approved to deploy it.") rather
75
+ than by adjectives. Almost no hype vocabulary: no "revolutionary", no "seamless",
76
+ no "unlock".
77
+
78
+ **Person.** Second person throughout, and specifically *you and your
79
+ organisation* as a pair. Almost every capability is argued twice:
80
+
81
+ > **For you** — Your agent already knows how things are done here.
82
+ > **For your organisation** — Standards that run, instead of standards in a wiki.
83
+
84
+ First person plural appears only where the company itself acts: "We'll introduce
85
+ you to the partner who built it."
86
+
87
+ **Spelling and casing.** British English: *industrialise*, *optimised*,
88
+ *organisation*, *prioritise*. Sentence case everywhere except the uppercase
89
+ micro-labels (eyebrows, part tags, key labels). Product names follow
90
+ [README.md](README.md).
91
+
92
+ **Headline construction.** Short, ending in a full stop, with a non-breaking space
93
+ binding the last two words so the balance never orphans:
94
+
95
+ > Everything your AI needs to go from knowing to doing.
96
+ > Intelligence without structure is costly chaos.
97
+ > Start from a blueprint that already works.
98
+
99
+ Headlines that turn on a pivot break at the pivot, one clause per line: the break
100
+ is authored, not left to `text-wrap`.
101
+
102
+ **The prompt as copy.** The page's signature device: every capability is also
103
+ expressed as a line you could paste into your own agent, in monospace behind a
104
+ red caret.
105
+
106
+ > ❯ Create an Alis Ideate interview for everyone who touches this process.
107
+ > ❯ Run alis define, then build and deploy this to our dev environment.
108
+
109
+ Prompts are written as real instructions: imperative, second person, sentence
110
+ case, ending in a full stop, never truncated.
111
+
112
+ **Parallelism.** Lists are strictly parallel and often anaphoric: *Always up to
113
+ speed. Always with you. Always collaborative. Always improving. Always governed.*
114
+ Each is one bold clause plus one plain sentence.
115
+
116
+ **Numbers.** Only where they are real. No invented stats, no "10x", no percentage
117
+ claims.
118
+
119
+ **Emoji.** None. Not in copy, not in UI, not in headings.
@@ -0,0 +1,111 @@
1
+ # Selection
2
+
3
+ **Selection is a petrol tonal fill, always carried by two properties.**
4
+
5
+ ## The decision
6
+
7
+ ```
8
+ Is this thing selected?
9
+ ├─ Yes → fill secondary-container
10
+ │ ink on-secondary-container
11
+ │ icon FILL 1 + weight 500
12
+ │ text weight 800 (.text-selected)
13
+ └─ No → transparent, on-surface-variant, icon FILL 0 + weight 400,
14
+ text at its role's own weight
15
+ ```
16
+
17
+ **Never colour alone.** Where a glyph has no filled version its weight still
18
+ changes, and where a glyph is identical filled and unfilled, selection rests on
19
+ weight alone. That is accepted; don't work around it locally.
20
+
21
+ **Selected text is 800** everywhere: list rows, the rail, tabs, segments and
22
+ tiles, one step above every role. Never 500. The selected component carries the
23
+ weight down to its title or label child, and turns a child's secondary ink to
24
+ `on-secondary-container` on the fill. Write the child's role as anywhere else;
25
+ never restate selection on a child.
26
+
27
+ ## Two strengths, one mechanism
28
+
29
+ ```
30
+ Where does this selected thing live?
31
+ ├─ Permanent chrome: on screen always,
32
+ │ a flat list on a flat ground → selection-chrome
33
+ └─ Everything else → secondary-container ← almost always
34
+ ```
35
+
36
+ **Permanent chrome is the app's navigation pane (the rail), and nothing else**,
37
+ so this is a lookup, not a judgment. A navigation list inside content is content.
38
+ Everything on a content plane takes the full fill, which has to clear the
39
+ `surface-container-highest` icon tiles beside it.
40
+
41
+ Petrol rather than M3's lilac, because lilac is also `cat3-container` and a
42
+ categorical chip beside a selected segment would share a fill.
43
+
44
+ ## Interaction states
45
+
46
+ A state layer (`.app-state`) is `on-surface` (or the control's own ink) laid over
47
+ the element:
48
+
49
+ - **Hover**: `state-hover`, 4%.
50
+ - **Focus**: capped to hover's opacity (`state-focus`, 4%), because at M3's
51
+ default a focused row looks selected. Focus is carried by a **2px `primary`
52
+ outline at 1px offset**, never removed.
53
+ - **Pressed**: `state-pressed`, 12%, on purpose: you press a row to select it.
54
+
55
+ Never add a third neutral step between hover and selection, and never hand-write
56
+ a hover fill: a plain element that needs hover, focus and press takes the state
57
+ layer. A drop target, while something is dragged over it, is `.drop-target`: a
58
+ 2px dashed `primary` outline and a `primary` wash at `state-dragged`, not a hover.
59
+
60
+ ## The selection tile
61
+
62
+ [AppSelectTile](../components/AppSelectTile.md): a card chosen among others.
63
+ Unselected it is the statement; selected it takes `secondary-container`, a filled
64
+ check and the selected weight, at the same size so nothing moves. **It is the
65
+ only way a chosen card is drawn:** never a tonal tint, a ring, a background swap
66
+ or a tonal/outlined switch.
67
+
68
+ Check the shape first: a fixed set of 2 to 5 that re-parameterises content in
69
+ place is a segmented control; a data-driven set is filter chips; a list is list
70
+ rows; a toggle is [buttons.md](buttons.md) § Icon buttons.
71
+
72
+ ## Rows and chip groups
73
+
74
+ - **A content-plane list row takes the full fill** and the selected weight
75
+ ([AppListRow](../components/AppListRow.md)).
76
+ - **A dense row may use a checked control as its second property.** Where a
77
+ checkbox already reports the state, the fill plus the checked box is the pair
78
+ and weight is left alone.
79
+ - **A selected filter chip** takes the selection fill
80
+ ([AppChip](../components/AppChip.md)).
81
+
82
+ ## Segmented controls · one track, one pill
83
+
84
+ A group of outlined toggle buttons is a segmented control
85
+ ([AppSegmented](../components/AppSegmented.md)). The outline belongs to the group:
86
+ one pill track with 4px of padding, which leaves room for the focus outline. The
87
+ selected segment is a `secondary-container` pill inset inside it, in
88
+ `on-secondary-container` at 800; the rest are transparent, in
89
+ `on-surface-variant` at 650. No dividers, no per-segment border. The system draws
90
+ the track, inks, weights and inset; never restyle a group locally.
91
+
92
+ ## A mark whose fill is already meaning
93
+
94
+ A data mark, like a timeline span or a diagram node, may already encode something
95
+ in its fill. **Selection rings it instead**: a 2px `on-surface` outline at 2px
96
+ offset. This is the one place an outline means selection, so hover (1px
97
+ `primary`), focus (2px `primary`) and selection must each look different, and
98
+ focus wins over selection. The mark's label takes ink at the selected weight,
99
+ never `primary`.
100
+
101
+ ## Near selection, and not it
102
+
103
+ - **Where you are** (the card a link points at, the machine you are on) is
104
+ location: a chip that says so, no fill. Choosing an account from a list is a
105
+ selection, not location: the fill and `check_circle`.
106
+ - **A step** in a sequence: done is a check, current a filled number in ink, next
107
+ an outlined number. Never `primary`.
108
+ - **Unread** is emphasis, 600, and a dot. No fill.
109
+ - **A button, a hover and a badge are not selections.** A button never shows an
110
+ active state to mean "current", and a row's badge hides once the row is
111
+ selected.
@@ -0,0 +1,88 @@
1
+ # Spacing, shape and depth
2
+
3
+ ## Space
4
+
5
+ **4 · 8 · 12 · 16 · 24 · 32 · 48. Nothing else** (D1). Tokens are named by
6
+ value: `space-4` … `space-48`.
7
+
8
+ | Context | Value |
9
+ |---|---|
10
+ | Card padding | 24, and 28 from 600px wide (`card-padding-wide`) |
11
+ | Between paragraphs | 24 |
12
+ | Between turns in a thread | 32 |
13
+ | Card to its caption | 8 |
14
+ | Minimum hit area | 48 (`touch-target`) |
15
+
16
+ **Card padding's 28 is the scale's one exception.** The card sets it on every one
17
+ of its parts, so a wide card breathes without anyone choosing a value; never
18
+ write it at a site.
19
+
20
+ **In a 48px table row, the row is the target.** A small button there is fine;
21
+ anywhere else it is D6.
22
+
23
+ **The agent chat list is 32px, and it is the only list that is** (`chat-row`,
24
+ `.app-row--agent-chat`). The list of past agent conversations in a navigation
25
+ pane runs at 32px rows, and so does its "Show N more", because at 48 they sat
26
+ level with the pane's destinations and a history of conversations read as more
27
+ places to go. The whole row is the target, above WCAG 2.2 AA's 24px, and a menu
28
+ button on a row projects no target of its own ([buttons.md](buttons.md)). The
29
+ group's heading and every destination in the pane stay 48.
30
+
31
+ **It does not generalise.** Not to projects, collections, files, members,
32
+ another pane or another history, however alike they look. It is not a density
33
+ option: there is no dense variant, prop or class to reach for, on purpose. A
34
+ second case is ruled on its own, never applied by similarity.
35
+
36
+ ## Shape
37
+
38
+ **4 / 8 / 12 / 16 / 28 / pill.** Radius climbs with the size of the object.
39
+ Buttons and pills are `radius-pill`, tables are `radius-0`, cards and text
40
+ fields are `radius-lg` (16) with a `radius-md` (12) inset, so the corners stay
41
+ concentric. 28 (`radius-xl`) is on the scale with no assigned use: nothing is
42
+ rounded to it by default, and the navigation pane's primary action is `radius-lg`.
43
+ There is no 24px step.
44
+
45
+ Radius is a dial. If it moves, change the token and move the inset with it,
46
+ never one card.
47
+
48
+ **A divider runs straight.** A row that carries a top or bottom border takes no
49
+ radius on that edge. In a rounded container only the first row takes the top
50
+ radius and the last the bottom, so the state layer still fits. Don't clip the
51
+ container (`overflow: hidden`), which clips a focus ring.
52
+
53
+ ## Depth
54
+
55
+ **Three levels, one brand recipe:** a 1px contact shadow plus a wide diffuse one,
56
+ in cool petrol rather than black.
57
+
58
+ - **`elevation-1`** resting
59
+ - **`elevation-2`** a card, the composer, sticky things, menus
60
+ - **`elevation-3`** dialogs and overlays
61
+
62
+ One shadow per level, never the Material 2 three-layer stack (A3), and never a
63
+ shadow on a flat surface.
64
+
65
+ **Hover never lifts.** A card rests at its level; a clickable card's hover is its
66
+ state layer ([selection.md](selection.md)).
67
+
68
+ **One border colour family:** `outline` for a rule, `outline-variant` for a
69
+ divider inside a surface.
70
+
71
+ ## Measure
72
+
73
+ **Prose is 710px wide** (`measure-prose`), about 84 characters. Thread content is
74
+ short paragraphs read in bursts, so the print range of 45 to 75 doesn't apply;
75
+ 540px was measured and rejected.
76
+
77
+ - A table in prose caps at 710px; as a view of its own it takes the full width,
78
+ because a table is scanned, not read.
79
+ - **All thread content shares one column and one set of edges.**
80
+ - **Persistent chrome aligns to the content column**, not to the viewport.
81
+
82
+ ## Layout
83
+
84
+ - Lay out sibling groups with flex or grid and `gap`. Never margins on each child,
85
+ never whitespace between inline elements.
86
+ - **A fixed height on anything containing text is a defect.** Let it grow.
87
+ - Nothing is positioned absolutely except decoration and overlays.
88
+ - Mobile is in scope for every rule here.
@@ -0,0 +1,83 @@
1
+ # Styling
2
+
3
+ **Appearance comes from the system; a site supplies mechanics.** Whatever the
4
+ framework (plain CSS, a utility library, CSS-in-JS, a component library's theme),
5
+ the same split holds.
6
+
7
+ ## Comes from the system
8
+
9
+ | Property | From |
10
+ |---|---|
11
+ | Colour, background | A role token. Never a hex ([colour.md](colour.md)) |
12
+ | A role at an alpha as a fill | The nearest role. Selected → `secondary-container` ([selection.md](selection.md)). A quiet panel → `surface-container-low`. A hover wash → delete it; the state layer is the hover |
13
+ | Border | `outline` or `outline-variant`, or a divider. A coloured border is a state: [selection.md](selection.md) or [chips-alerts.md](chips-alerts.md) |
14
+ | Radius | `radius-0`, `-xs`, `-sm`, `-md`, `-lg`, `-xl`, `-pill`. No 24px step |
15
+ | Shadow | `elevation-1`, `-2`, `-3`, or nothing ([spacing.md](spacing.md)). Never a shadow and a border |
16
+ | Font, size, line height, tracking, weight | A `text-*` style. Beside it: `.text-mono` (the face), `.text-emphasis` (600), `.text-selected` (800, selection only) |
17
+ | Spacing | `space-*` |
18
+ | Hover, focus, pressed on a plain element | The state layer, `.app-state` ([selection.md](selection.md)) |
19
+ | Rendered markdown | `.prose`, `.prose-compact` ([type.md](type.md)). Never reach into prose to restyle it |
20
+ | A card chosen among others | [AppSelectTile](../components/AppSelectTile.md) |
21
+ | A statement over a gradient | `.app-statement-over-gradient` ([surfaces.md](surfaces.md)) |
22
+ | A drop target while dragging over | `.drop-target` |
23
+ | Scrollbars | Nothing: one thin `outline-variant` treatment for the app |
24
+
25
+ Configure your framework's theme once from the tokens, so its components
26
+ inherit the system. Never fight the framework with a local override, a
27
+ forced-priority rule (`!important`) or a selector reaching into a component's
28
+ internals: settle it once, app-wide, in the theme, or not at all.
29
+
30
+ ## May stay at a site
31
+
32
+ - **Layout.** Grid templates and placement, flex, widths and min/max sizes (never
33
+ a fixed height on text), overflow, position and offsets for decoration and
34
+ overlays only, z-index, aspect-ratio, object-fit, pointer-events, cursor,
35
+ white-space, word-break, text-overflow, and media or container queries around
36
+ any of these.
37
+ - **Spacing**, only where the system's own spacing can't reach (a grid gap,
38
+ inside a media query), and only on the scale.
39
+ - **Motion.** Keyframes, transitions, animation, transform, opacity, using the
40
+ duration and easing tokens. A colour inside a keyframe is still a role.
41
+ - **Drawing.** Fill, stroke and stop colour on SVG marks, from roles. A role at an
42
+ alpha is allowed for an area or a band in a drawing, and for the `scrim` behind
43
+ text on an image. **Nowhere else.**
44
+
45
+ **A computed inline style** may carry position or size (a progress width, a
46
+ column width, a drag offset), and colour only for drawing. A static `style=""`
47
+ is a stylesheet without the tag, under the same rules as any other.
48
+
49
+ An empty rule is deleted, and so is a class whose only declaration was deleted.
50
+
51
+ ## Kept on purpose
52
+
53
+ - **Tonal chips and alerts**: their status or label role at 12% behind the same
54
+ role as ink. This is the one fill at an alpha outside drawing, defined once
55
+ in the component classes, never written at a site.
56
+ - The AI identity gradients for Ideate and the Specialists.
57
+ - Third parties themed from the tokens at runtime (diagram and syntax renderers)
58
+ and a terminal's ANSI palette: machine speech, not ours to redesign. Their
59
+ ground is a surface role, or `inverse-surface` when it is dark.
60
+ - **A full-bleed media stage is black**, because `inverse-surface` is a blue-grey
61
+ that would cast on someone's photograph. Every other dark ground is
62
+ `inverse-surface`.
63
+
64
+ ## A gap is a finding
65
+
66
+ If nothing in the tables fits, **the system has a gap.** Build what you need from
67
+ role tokens (`var(--…)`, never a literal), mark it `GAP` in a comment, and name it
68
+ when you hand the work back (where, and what it needs). An existing declaration
69
+ with no home is left where it is and reported the same way. Never promote it to a
70
+ global class or invent a role: the system changes once, by decision.
71
+ [known-gaps.md](known-gaps.md) lists the ones already known.
72
+
73
+ ## Enforce it
74
+
75
+ Lint for what can be linted: hex literals, off-scale spacing and radius, shadows,
76
+ local font declarations and forced-priority overrides in component code. Run it
77
+ as a ratchet, failing when a file gains violations, so an existing backlog
78
+ doesn't block new work. Re-record the baseline only after an intentional change,
79
+ never to clear a failure, and say in the commit why the number moved.
80
+
81
+ Check by hand what a linter can't see: a static `style=""` attribute in a
82
+ template, and a case transform in code (`toUpperCase()` on displayed text),
83
+ which shouts exactly as `text-transform` would.
@@ -0,0 +1,75 @@
1
+ # Surfaces
2
+
3
+ ## Three roles, plus the lattice
4
+
5
+ ```
6
+ What is this containing?
7
+ ├─ The app itself → the ground (background): every pane, the thread column
8
+ ├─ Content you READ, continuous → the lattice: no box at all
9
+ ├─ Grouped context, not acted on directly → a statement (surface-container-low): filled, flat
10
+ └─ An object you ACT on → an instrument (surface): white, elevation-2
11
+ ```
12
+
13
+ Default when unsure: **no container** (B6). Before adding a card, try spacing, a
14
+ heading or a divider.
15
+
16
+ ## The rules
17
+
18
+ - **No pane of the layout is a white card, and nor is the thread column.** They
19
+ sit on the ground, and the shell's panes default to it
20
+ ([AppShell](../components/AppShell.md)), so a white card always reads as an
21
+ object.
22
+ - **If a white card would sit on a white parent, the parent is wrong** (A1).
23
+ - **No borders on cards.** Separation comes from fill and elevation (A2).
24
+ - **No step under 1.0 L\*.** Below that, two surfaces are indistinguishable.
25
+ - **Direction agrees with elevation.** A lighter surface implies lift, so it
26
+ carries the shadow that confirms it.
27
+ - **One inset level.** A panel inside a card is fine; a panel inside that is not.
28
+ - **A statement carries at most one text (tertiary) link.** If it needs a
29
+ primary, it is an instrument.
30
+ - **An instrument puts its actions in one action row.**
31
+ - **A card you open is an instrument**, because opening it is acting on it. It
32
+ rests white at `elevation-2`, the default for [AppCard](../components/AppCard.md)'s
33
+ instrument, and its hover is the link's state layer, never a lift.
34
+ - **Cards in a collection are coplanar**: the same resting elevation and the same
35
+ left and right edges.
36
+ - **A table, a skeleton and a list paint no surface.** Each takes the one it sits
37
+ on: the ground on a page, white in a card, a dialog or a menu. So a list in a
38
+ pane, the rail, a statement or a card is transparent, and a table or skeleton
39
+ never sets a fill. Only a menu's list is white, because there it is the surface.
40
+
41
+ ## Neutral surfaces, one accent
42
+
43
+ Grounds, panes and selection stay neutral, because alisx.com is built that way: a
44
+ near-white canvas, light grey panels, and cyan only where you can act. A tinted
45
+ surface spends the one accent on something you cannot press. The brand comes
46
+ through type weight, the Alis mark and the primary action.
47
+
48
+ ## The statement
49
+
50
+ `surface-container-low`: `on-surface` at 4% over the ground. It is known by what
51
+ it holds and where it sits, so never use its fill to make something visible, and
52
+ never derive a fourth surface between it and the ground.
53
+
54
+ **Over a gradient** it is `.app-statement-over-gradient`: the same 4% of
55
+ `on-surface` laid over whatever is beneath (`state-statement`), because the solid
56
+ fill turns faint and warm against colour. Only there; on the ground it stays
57
+ `surface-container-low`.
58
+
59
+ ## The lattice · content you read
60
+
61
+ [AppLattice](../components/AppLattice.md) (`.app-lattice`): a hairline across the
62
+ top, a 44px accent tick at the leading edge, an eyebrow ([type.md](type.md)), then
63
+ the content. **No fill, no shadow, no radius, no box.**
64
+
65
+ Use it for continuous content that is read rather than manipulated: overview
66
+ documents, synthesis sections, agent findings, long rendered artifacts. The tick
67
+ may take a product tone where the section belongs to one.
68
+
69
+ ## Depth
70
+
71
+ Transparency and blur appear in exactly four places: a floating nav pill, glass
72
+ on a dark panel, a dialog backdrop, and the statement over a gradient.
73
+
74
+ No card relies on a shadow to be legible, so every rule here survives a dark
75
+ theme.