@alis-build/design-system 0.58.0 → 0.61.1

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.
package/rules/branding.md CHANGED
@@ -52,6 +52,9 @@ component. A product with existing brand variables maps them once in its adapter
52
52
  - Brand and light/dark preference are separate. Set `data-theme` as in
53
53
  [themes.md](themes.md). A profile supplies both modes, or the unsupported mode
54
54
  inherits a validated system/account theme. Do not infer mode from the logo.
55
+ - Contrast and forced colours outrank a brand: under either, apply no role
56
+ override from the profile; the logo stays, on a transparent ground
57
+ ([themes.md](themes.md) § Contrast and forced colours).
55
58
  - CSS custom properties do not cross an iframe. The embedded portal resolves
56
59
  the same profile as its hosted page. A host theme preference may cross a
57
60
  validated integration channel; accept only the documented values from the
package/rules/colour.md CHANGED
@@ -79,7 +79,7 @@ alone; a chip or an alert carries the status ([chips-alerts.md](chips-alerts.md)
79
79
  ## Categories
80
80
 
81
81
  **Six hues from the brand, each a Material 3 tonal palette.** alisx.com colours
82
- its products violet (Build), mint (Specialists), apricot (Skill store) and cyan
82
+ its products violet (Build), mint (Specialists), apricot (the AlisX Skill Store) and cyan
83
83
  (Ideate). Spaced 60° apart from the brand cyan, those land on the spokes of a
84
84
  six-hue wheel; rose and lime fill the other two. That wheel is the category set,
85
85
  in this order:
package/rules/email.md CHANGED
@@ -170,6 +170,12 @@ Never a category.
170
170
  - **Fonts**: Nunito Sans where the mail app loads it, then Arial.
171
171
  - **A plain-text twin of every email** (`shell.txt`): the same words, the link
172
172
  written out.
173
+ - **Always sent as UTF-8.** A mail service sends a message whose characters all
174
+ fit Latin-1 (a "·", an "é" in a name) as ISO-8859-1, and Gmail then shows
175
+ "[Message clipped]" under an email it has shown in full. The shell's preview
176
+ line and the last line of `shell.txt` each carry an invisible character
177
+ outside Latin-1, which keeps both parts UTF-8. Keep them as characters, never
178
+ as entities; `make generate` fails without them.
173
179
  - **Colours come from the roles.** `source/email/` writes `[[role]]` and
174
180
  `[[role:dark]]`, and `[[role/12]]` for an alert's tint (the role at 12% over
175
181
  `surface`); `make generate` resolves them, and fails on a name that isn't a
package/rules/hosts.md ADDED
@@ -0,0 +1,172 @@
1
+ # Hosts
2
+
3
+ **A host is a product whose look wins over ours:** Microsoft Teams, Microsoft
4
+ 365 Copilot, ChatGPT, Claude, Slack. The host draws the chrome, the type and the
5
+ colour. We supply the words, the decisions, the states and what happens when
6
+ someone presses a button, and those are what make it Alis. A mail app and a
7
+ terminal are hosts too, with rules of their own ([email.md](email.md),
8
+ [terminal.md](terminal.md)); this file is every other one.
9
+
10
+ Each host has a profile in [hosts/](../hosts/README.md): one page and one data
11
+ file. This rule holds everything that is the same in every host; a profile holds
12
+ only where its host differs.
13
+
14
+ ## The stance
15
+
16
+ **Native or ours, never a blend.** What sits inside the host's conversation (a
17
+ described card, a framed view) is native: the host's components, type, colour
18
+ and spacing. A framed page is wholly ours: the product register, on the host's
19
+ theme. Nothing mixes the two. Inside the conversation, Alis shows through:
20
+
21
+ - **Alis named**, and the words from `words.json` ([words.md](words.md)).
22
+ - **The decisions**: one action that matters, states said in words, what was
23
+ done read back with its counts.
24
+ - **The glyphs**: a thing's glyph by name ([AppAttachment](../components/AppAttachment.md)),
25
+ in the host's own icon set.
26
+ - **Our accent on the filled action**, and only where the profile says the host
27
+ allows it.
28
+
29
+ The host draws our name and icon above what we send. Never draw the mark, the
30
+ wordmark or a logo inside a card or a widget.
31
+
32
+ ## Names
33
+
34
+ Alis is the agent; the AlisX Platform is the product; Alis Exchange is the
35
+ maker. In a host they read:
36
+
37
+ | What | Reads | Never |
38
+ | --- | --- | --- |
39
+ | **The listing**, in every store | **AlisX**, published by **Alis Exchange**. One AlisX listing per store | Alis Agent, AlisX Agent Companion, a host's product in the name ("for Microsoft 365") |
40
+ | **The listing's description** | What it offers, speaking of the AlisX Platform, and of Alis for the agent: "AlisX connects Microsoft Teams to the AlisX Platform, so you can hand work to Alis". *Agent* goes here, never in a name | |
41
+ | **Who answers** | **Alis**, writing "I". The first message says who: "Hi, I'm Alis, the agent on the AlisX Platform." | the Alis agent, your Alis agent, your agent, the agent, it |
42
+ | **Who signs in** | **your AlisX account**: "Connect your AlisX account", "Signed in to AlisX as thandi@acme.com" | your Alis account, an Alis Build account |
43
+ | **Where it goes** | The thing itself ("Open interview"); in a sentence, **the AlisX console** | the console: in a host that is the host's own, or nothing |
44
+ | **A product or a tool** | Only on what belongs to it, in full. A tool by its name ("Open Alis Ideate Interviews"); a thing as a common noun, the product after it ("your projects in Alis Ideate", "a deploy in Alis Build") | "your Alis Ideate projects" (it reads as the tool with a wrong capital); AlisX projects; Ideate or Build doing something |
45
+
46
+ Every one of these is in `words.json`. A host's own words for its own things
47
+ stay the host's: in Claude, Alis is "the AlisX connector", because Claude
48
+ calls it a connector.
49
+
50
+ ## Which kind of host
51
+
52
+ ```
53
+ Who draws what we send?
54
+ ├─ The host, from a description we send
55
+ │ (an Adaptive Card, Slack blocks) → DESCRIBED
56
+ ├─ Our own small view, in the host's frame,
57
+ │ inside the conversation (an MCP app widget) → FRAMED VIEW
58
+ └─ Our own page, filling the host's frame
59
+ (a Teams tab, a dialog with a page) → FRAMED PAGE
60
+ ```
61
+
62
+ | | Described | Framed view | Framed page |
63
+ | --- | --- | --- | --- |
64
+ | **We send** | Structure and roles by meaning; the profile names the host's word for each | HTML and CSS in a sandboxed frame | A product page |
65
+ | **Colour** | The host's, picked by role. Never a hex value | The host's variables, our roles mapped onto them (the profile's table). Our accent on the filled action only where allowed | The product roles ([colour.md](colour.md)) |
66
+ | **Type** | The host's | The host's font and scale | Ours ([type.md](type.md)) |
67
+ | **Theme** | The host's, contrast included | The host's, from what it sends; the profile's fallback when it sends nothing | The host's, through the profile's map ([themes.md](themes.md) § Who picks the theme) |
68
+ | **Components** | The host's elements | Plain HTML on the host's variables; no `.app-*` component | `.app-*`, the whole product register |
69
+
70
+ A framed page doesn't draw what the host already draws: no second title bar, no
71
+ navigation pane, no sign-in screen when the host has signed the person in.
72
+
73
+ ## What we send
74
+
75
+ A host gets the conversation the console has, translated: nothing is invented
76
+ for one host. Five things, each from a component the system already has.
77
+
78
+ | What | From | In a host |
79
+ | --- | --- | --- |
80
+ | **Alis's reply** | [AppTurn](../components/AppTurn.md) | A message, the default. It streams where the host streams, and Alis writes "I". Thumbs are the host's own reactions where it has them. A card only when a press or a structure is needed |
81
+ | **Alis needs you** | [AppAsk](../components/AppAsk.md), any kind | A card. The question is its title; up to four fields say what will happen. Options are rows you press to answer, never buttons. Choose several is the host's own checklist, then the verb. Then Not now and the verb named by its outcome, in AppAsk's order; AppAsk's wider scope ("Allow for this session") isn't offered in a host, so an ask keeps two actions. A press or an answer typed in the host's composer closes it: "yes, go ahead" allows it. It then reads back as AppAsk's record ("Allowed: Send 6 invites", "Not now: …") and loses its actions. Connect is AppAsk's Connect |
82
+ | **A thing** | [AppAttachment](../components/AppAttachment.md) | A card, or a row in one: its glyph, its name, its kind and a detail, up to four fields. The whole tile opens it, so rows of things need no button each |
83
+ | **Work** | AppTurn's steps, with the composer's Stop | The task card: the task's name, its state in words (Queued, Working, Stopping, Stopped, Failed, Finished), at most three steps; once finished, what was done with its counts ("Interview created, 0 people invited") |
84
+ | **Too big for a card** | [AppFilePane](../components/AppFilePane.md), a page | The expanded view: a framed page beside or over the conversation, where the host has one. *Open task* opens a task there; *Open interview* (the thing's name) opens a thing in the console |
85
+
86
+ **The task card carries the composer's controls**, because in a host the
87
+ composer is the host's. Two at most, by state: *Stop* while it works; *Try
88
+ again* and *Open task* when it failed; *Open task*, and *Open* and the kind of
89
+ thing it made ("Open interview"), once finished. Stop acts at once: stopping is
90
+ your choice, never confirmed and never red ([AppTurn](../components/AppTurn.md)). The card updates
91
+ in place where the host can; where it can't, its last line says how to check:
92
+ "Ask Alis how it's going."
93
+
94
+ **Order in a turn**: Alis's words first, then an ask or the task card after
95
+ them. Nothing interrupts the words; a host draws a card only once a stream has
96
+ closed.
97
+
98
+ A new kind of card is a decision for this file, never a card built in one host.
99
+
100
+ ## Every host
101
+
102
+ These hold everywhere, and a profile never repeats them:
103
+
104
+ 1. **Two actions at most, the verb last**, in the order of [buttons.md](buttons.md).
105
+ An ask's options and rows that open what they name are answers and ways in,
106
+ not actions.
107
+ 2. **Nothing scrolls inside a card.** No tabs, no menus, no drill-in, no paging,
108
+ no search inside a card. Long content goes to the expanded view.
109
+ 3. **No message box of our own.** The host's composer is the only one: no note
110
+ field inside an ask, because what you type in the composer is the note.
111
+ 4. **Every state said in words**, and loading, finished, stopped and failed each
112
+ drawn ([loading.md](loading.md)). A failure says what to do next, in a
113
+ sentence, never a command to type ([errors.md](errors.md)).
114
+ 5. **Narrow first.** Everything works at 320 wide.
115
+ 6. **Every theme the host has.** A described card takes the host's own themes,
116
+ contrast included. A framed view or page maps the host's theme names through
117
+ its profile ([themes.md](themes.md)).
118
+ 7. **A text twin.** Every described card carries fallback text saying the same
119
+ thing in a sentence, for a host or a reader that can't draw it.
120
+ 8. **An icon names a thing or a state, never decorates.** A thing's glyph, or a
121
+ state's icon in its state's role. Never one beside a title for its own sake,
122
+ never a colour for a kind of thing, never an emoji or a hand-drawn icon: the
123
+ host's icon set, through the profile's name map ([icons.md](icons.md)).
124
+ 9. **The words of the product**, and the names in § Names. Alis is named,
125
+ never "your agent", "the agent" or "the assistant". The work is a *task*; *session* is only a coding-agent
126
+ session; never *workspace*. Never tell someone to type a command ("Send
127
+ /status"): say what to do. A host is named as its maker names it: Microsoft
128
+ Teams, Microsoft 365 Copilot, Cowork ([words.md](words.md)).
129
+ 10. **The console is one link away**: *Open* and the kind of thing ("Open
130
+ interview") lands on the thing itself, never the console's home
131
+ ([page.md](page.md)).
132
+
133
+ ## Onboarding a host
134
+
135
+ A host is onboarded once and re-checked on a date. Its profile has five
136
+ sections, in this order:
137
+
138
+ 1. **Sources and evidence.** What the host can do, each claim with its link, the
139
+ date it was checked and a tag: **limit** (the host enforces it), **advice**
140
+ (the host recommends it) or **observed** (we saw it happen). When the host's
141
+ pages disagree, say so and test it. A probe (a card and a view that report
142
+ what the host sends and draws) outranks the docs.
143
+ 2. **Jobs here.** Which jobs this host serves, which it hands to another surface,
144
+ and the limit from section 1 that forces each hand-off. A host serves jobs
145
+ from the product's one list; it never grows a strategy of its own.
146
+ 3. **Differences.** Only where this host differs from this file, as data in the
147
+ profile's `.json` first and a line of prose second: its surfaces and their
148
+ kind, its store's rules for a listing's name, its limits, its words for our roles, its icon names, its theme map, and
149
+ how far our accent may go.
150
+ 4. **Proof.** Each card rendered as the host draws it: from the host's own
151
+ renderer with the host's own settings, and a screenshot of the real host,
152
+ light and dark. Something built before the rule is not proof.
153
+ 5. **Re-check.** Who owns the profile, when it was checked, and what makes it due
154
+ again: a date, or the host's changelog.
155
+
156
+ **What already ships stays until it conforms.** When a host is onboarded, the
157
+ cards it already shows go into a baseline and are brought to this file over
158
+ time; anything new follows it from the start. A host with no profile gets only
159
+ the probe.
160
+
161
+ ## Before you hand it back
162
+
163
+ 1. Is it one of the five things above, from its component, with no more than
164
+ two actions and the verb last?
165
+ 2. Does it use the host's colours by role, with no hex value, no logo and no
166
+ decorative icon?
167
+ 3. Does every state say itself in words, and does a described card carry its
168
+ text twin?
169
+ 4. Does it hold at 320 wide, in every theme the host has?
170
+ 5. Is every word from `words.json`, with Alis named and no command to type, and
171
+ is the listing AlisX, published by Alis Exchange?
172
+ 6. Did the profile's check pass on the host's own rendering of it?
package/rules/icons.md CHANGED
@@ -28,14 +28,14 @@ icons, not brand marks: each names its tool wherever a symbol would.
28
28
 
29
29
  | Name | Tool |
30
30
  | --- | --- |
31
- | `alis_projects` | Ideate projects |
32
- | `alis_interviews` | Ideate interviews |
33
- | `alis_artifacts` | Ideate artifacts |
34
- | `alis_environments` | Build environments |
35
- | `alis_skills` | Skill store |
36
- | `alis_workstations` | Remote workstations |
37
- | `alis_activity` | Activity: what people and agents are doing, and have done |
38
- | `alis_support` | Support: conversations with a build specialist |
31
+ | `alis_projects` | Alis Ideate Projects |
32
+ | `alis_interviews` | Alis Ideate Interviews |
33
+ | `alis_artifacts` | Alis Ideate Artifacts |
34
+ | `alis_environments` | Alis Build Environments |
35
+ | `alis_skills` | AlisX Skill Store |
36
+ | `alis_workstations` | Alis Build Workstations |
37
+ | `alis_activity` | Activity: a place in the console, not a tool. What people and agents are doing, and have done |
38
+ | `alis_support` | Support: the console's heading for AlisX Specialists. Your conversations with a specialist |
39
39
  | `alis_glass` | The Glass view: not a tool, a way of seeing every tool's things ([glass.md](glass.md)) |
40
40
 
41
41
  - **Use one by name, exactly like a symbol**: route every `alis_` name in your
@@ -7,7 +7,7 @@ What the system doesn't decide yet, in one place. When you hit one, take the qui
7
7
  - **Date and time pickers**. Use a text field with a format hint.
8
8
  - **A bar of actions for several chosen rows** ("3 selected"). [AppCheckbox](../components/AppCheckbox.md) chooses them; what acts on them has no pattern yet. When some of the chosen are beyond the person's role, how the bar counts and reports them is already settled ([access.md](access.md) § Several at once).
9
9
  - **The marketing components** (`.ax-*`, alisx.com) are not in this package: it covers the product register. A layout class for a grid of lattices is missing too.
10
- - **What the Skill store and the Specialists offer**, beyond their one-line descriptions in [README.md](README.md). Marketing copy about them needs a product brief.
10
+ - **What the AlisX Skill Store and AlisX Specialists offer**, beyond their one-line descriptions in [README.md](README.md). Marketing copy about them needs a product brief.
11
11
  - **A standalone bulk uploader**, beyond conversation attachments. Conversation uploads are covered by [AppAttachment](../components/AppAttachment.md) and [AppComposer](../components/AppComposer.md).
12
12
  - **A dismissible alert**.
13
13
  - **A full-size view** ([page.md](page.md) § A full-size view) has no classes yet: build its bar from the title bar's parts and its ground from `machine-surface`'s black stage or `surface`, and mark it `GAP`.
@@ -20,6 +20,10 @@ What the system doesn't decide yet, in one place. When you hit one, take the qui
20
20
  - **An account's own roles, and seats.** `words.json` names the roles on a thing (Owner, Editor, Viewer); an account's roles (an admin, a builder, a curator) and its seats are not in it yet. Say what the person needs in the screen's own words ("ask an admin of Acme"), and add the entries with the first change.
21
21
  - **Admin's words.** `words.json` names what Alis Ideate, Build and every product share; Admin's own things are not in it yet. Name them as the screen already does, and add the entry with the first change ([words.md](words.md)).
22
22
  - **A terminal's drawn text.** `alisx-check words --text` reads the CLI's words file: its help, `alis docs`, the TUI's views and actions, tips, the tour and errors. Text the TUI writes straight into a screen (column headers, intros, empty states) is not in that file yet; review it by eye against `words.json` ([terminal.md](terminal.md)).
23
+ - **Hosts.** The checks a host profile asks for (`alisx-check cards`, a profile past its date) and the card templates aren't built yet ([hosts.md](hosts.md)).
24
+ - **Increase contrast** (`prefers-contrast: more`) has no answer; nothing writes a rule for it yet ([themes.md](themes.md) § Modes).
25
+ - **A chart in contrast or under forced colours** loses its series colours: the categories collapse to ink. Label every series directly, or give it a pattern, until charts have a contrast answer ([themes.md](themes.md)).
26
+ - **A Glass view in contrast or under forced colours** hasn't been looked at: its rim and grid drop away and its edge takes the contrast edge, but nobody has checked it reads ([glass.md](glass.md), [themes.md](themes.md) § Contrast and forced colours).
23
27
  - **A log viewer.** "View logs" goes to the logs' own screen; there is no pattern for showing logs inside a pane.
24
28
  - **Each product's destinations** (the rows under its heading in the rail) are product content, not part of this system. Use the capability marks for the tools they name.
25
29
 
package/rules/motion.md CHANGED
@@ -93,7 +93,7 @@ on every screen.
93
93
  | `loop-dots` | 1.2s | The working dots, the Alis mark's loader, the recording dot |
94
94
  | `loop-pulse` | 1.6s | Something live or running: a live dot, a running state |
95
95
  | `loop-breathe` | 3.2s, there and back | A large, calm glow: the composer's light, the voice orb; a Glass theme still forming |
96
- | `loop-orbit` | 3.2s, even | A capability mark's dot going round its path while live: the Skill store's |
96
+ | `loop-orbit` | 3.2s, even | A capability mark's dot going round its path while live: the AlisX Skill Store's |
97
97
  | `loop-flow` | 4s, even | A particle on a Glass view's field: an event happening now |
98
98
  | `loop-look` | 5s, there and back | The Glass mark's live part looking about while a Glass view reads live |
99
99
  | `loop-speak` | 1.3s | The Interviews mark's first line talking while someone answers; the Support mark's mic while a person replies |
@@ -56,11 +56,12 @@ AppShell
56
56
  | A form | `.app-form` of fields, one filled action last (see § Forms) |
57
57
  | A form in named steps | `AppStepper` at the top of the form's card; Back on the leading edge, one filled forward action ([page.md](page.md) § A form in steps) |
58
58
  | Text | `AppTextField` (with `action` for one that collects several values, shown as input `AppChip`s below) |
59
- | A code from an email or a device | `AppCodeField`: one input drawn as cells; it never sends itself |
59
+ | A code from an email or a device | `AppCodeField`: one input drawn as cells; it sends itself once, when the last character lands |
60
60
  | One choice from a list | `AppSelect`; past about ten options, or to choose several, `AppCombobox` |
61
61
  | An on/off setting | `AppSwitch` |
62
62
  | Several of a list, or something to agree to | `AppCheckbox`; one of a few short options is its radio ([page.md](page.md) § Which control) |
63
63
  | A choice among cards, labelled | `AppSelectTile`s in an `AppFieldset` |
64
+ | Things a person browses and opens (skills, projects, templates) | `.app-card-grid` of `AppCard`s you open, in five zones with the foot at the bottom ([AppCard](../components/AppCard.md) § In a collection) |
64
65
  | A person, an organisation, or an icon leading a row | `AppAvatar`: a person round, a thing a square tile; 24, 36 or 80 |
65
66
  | Detail few people need | `AppDisclosure`, closed by default |
66
67
  | Views that switch in place inside a pane or a dialog | `AppSegmented` at its head; never tabs |
package/rules/register.md CHANGED
@@ -20,6 +20,12 @@ What am I building?
20
20
  │ (Show it or explain it)
21
21
  ├─ An email → PRODUCT, built from the
22
22
  │ email shell (email.md)
23
+ ├─ A card or a widget inside another product's
24
+ │ conversation (Teams, Copilot, ChatGPT, Slack) → THE HOST'S look, by
25
+ │ hosts.md and its profile
26
+ ├─ A page filling another product's frame
27
+ │ (a Teams tab) → PRODUCT, on the host's
28
+ │ theme (hosts.md)
23
29
  └─ alisx.com, a landing page, a deck → NARRATIVE
24
30
  ```
25
31
 
@@ -155,7 +161,7 @@ is authored, not left to `text-wrap`.
155
161
  expressed as a line you could paste into your own agent, in monospace behind a
156
162
  red caret.
157
163
 
158
- > ❯ Create an Alis Ideate interview for everyone who touches this process.
164
+ > ❯ Create an interview in Alis Ideate for everyone who touches this process.
159
165
  > ❯ Run alis define, then build and deploy this to our dev environment.
160
166
 
161
167
  Prompts are written as real instructions: imperative, second person, sentence
package/rules/spacing.md CHANGED
@@ -94,6 +94,10 @@ short paragraphs read in bursts, so the print range of 45 to 75 doesn't apply;
94
94
 
95
95
  - Lay out sibling groups with flex or grid and `gap`. Never margins on each child,
96
96
  never whitespace between inline elements.
97
+ - **Spacing is set once, by the container.** A part of a card, a row or a pane
98
+ that pads itself adds to the container's gap, and the sum lands off the scale
99
+ (8 + 12 + 8 is 28). Where two parts need a different gap, the component draws
100
+ it (AppCard's 16 around its cover and foot); a site never does.
97
101
  - **A fixed height on anything containing text is a defect.** Let it grow.
98
102
  - Nothing is positioned absolutely except decoration and overlays.
99
103
  - Mobile is in scope for every rule here.
package/rules/styling.md CHANGED
@@ -112,7 +112,10 @@ The package ships what can be linted, so every app checks the same things
112
112
  - **`alisx-check names`** fails on a system class or a custom property the
113
113
  installed version doesn't have (`classes.json`): a misspelt class renders
114
114
  unstyled and says nothing. A property that arrives at run time (a client's
115
- theme) is known once the file that declares it is named.
115
+ theme) is known once the file that declares it is named. The
116
+ `--contrast-*` properties `classes.json` lists are the contrast block's own
117
+ slots: never use them in your CSS; use the roles, and the block draws high
118
+ contrast ([themes.md](themes.md) § Contrast and forced colours).
116
119
 
117
120
  Check by hand what a linter can't see: a computed style binding, a value behind
118
121
  a variable of your own, a case transform in code (`toUpperCase()` on
package/rules/surfaces.md CHANGED
@@ -35,6 +35,12 @@ heading or a divider.
35
35
  instrument, and its hover is the link's state layer, never a lift.
36
36
  - **Cards in a collection are coplanar**: the same resting elevation and the same
37
37
  left and right edges.
38
+ - **A card's parts bring no padding of their own**: the card's padding and gap
39
+ space them. **Cards in a collection share one shape**: `.app-card-grid` and the
40
+ five zones in [AppCard](../components/AppCard.md) § In a collection, so a new
41
+ fact fits a zone or goes on the thing's page, never a new row.
42
+ - **A card you open holds nothing else to press**: no menu, no button. What you
43
+ might do to one item lives on its page, or once in the section's heading row.
38
44
  - **A table, a skeleton and a list paint no surface.** Each takes the one it sits
39
45
  on: the ground on a page, white in a card, a dialog or a menu. So a list in a
40
46
  pane, the rail, a statement or a card is transparent, and a table or skeleton
package/rules/themes.md CHANGED
@@ -1,8 +1,14 @@
1
1
  # Themes
2
2
 
3
- Two themes, light and dark, from one set of roles. **A page is light unless it
4
- asks.** Build with roles and both themes come free; a colour that isn't a role
5
- breaks the moment the theme changes.
3
+ Two themes, light and dark, from one set of roles, and one more, contrast, that
4
+ only a host asks for. **A page is light unless it asks.** Build with roles and
5
+ every theme comes free; a colour that isn't a role breaks the moment the theme
6
+ changes.
7
+
8
+ Three things are kept apart here: a **theme** (light, dark, contrast: the
9
+ values the roles take), a **mode** (forced colours, reduced motion: what the
10
+ operating system imposes over any theme), and **who picks** the theme on each
11
+ surface (§ Who picks the theme).
6
12
 
7
13
  ## Asking for a theme
8
14
 
@@ -13,12 +19,18 @@ breaks the moment the theme changes.
13
19
  | *(none)* | Light |
14
20
  | `light` | Light |
15
21
  | `dark` | Dark |
16
- | `system` | Whatever the operating system prefers |
22
+ | `system` | Whatever the operating system prefers: light or dark, never contrast |
23
+ | `contrast` | High contrast. Only where a host profile maps to it, and only on `<html>` (§ Contrast and forced colours) |
17
24
 
18
25
  - **An app owns the choice.** It resolves the person's preference (System,
19
26
  Light, Dark) and sets `data-theme` on `<html>` before first paint, so the
20
27
  page never flashes the wrong theme. The package ships no script for it.
21
- - **A section can take its own theme.** Every role is written as
28
+ - **`data-theme` takes only these four names**, never a host's own. A host
29
+ that reports its theme (Teams says `default`, `dark`, `contrast`, `glass`) is
30
+ translated in one place, from its profile's map (`hosts/teams.json` § theme),
31
+ and a name the map doesn't know takes its fallback.
32
+ - **A section can take its own theme**, light or dark; contrast is the whole
33
+ page or nothing. Every role is written as
22
34
  `light-dark(light, dark)` and resolved where it is used, so a dark section in a
23
35
  light page (or the reverse) is right all the way down. `alisx.css` paints a
24
36
  section's ground and ink (`background`, `on-surface`); with `tokens.css` alone,
@@ -30,6 +42,75 @@ breaks the moment the theme changes.
30
42
  - A browser without `light-dark()` (before Chrome 123, Firefox 120, Safari 17.5)
31
43
  gets the light theme.
32
44
 
45
+ ## Who picks the theme
46
+
47
+ | Surface | Who picks | We supply |
48
+ | --- | --- | --- |
49
+ | The console and our own pages | The person: System, Light or Dark | Light and dark |
50
+ | Email | The mail app | Light and dark, written in ([email.md](email.md)) |
51
+ | The terminal | The terminal | Roles only ([terminal.md](terminal.md)) |
52
+ | A described card in a host (Teams, Slack) | The host | Roles only: the host draws it ([hosts.md](hosts.md)) |
53
+ | A framed view in a host (Copilot, ChatGPT, Claude) | The host, from what it sends | Light or dark, from its profile's map ([hosts.md](hosts.md)) |
54
+ | A framed page in a host (a Teams tab) | The host | Whatever its profile's map says, contrast included |
55
+
56
+ Every surface drawn in HTML also honours the modes below, whoever picks its
57
+ theme.
58
+
59
+ ## Modes
60
+
61
+ The operating system can impose these over any theme. Nothing sets them, and
62
+ every HTML surface honours them:
63
+
64
+ - **Forced colours** (Windows high contrast): the system replaces every colour,
65
+ drops shadows and flattens fills. `alisx.css` keeps what matters visible
66
+ (§ Contrast and forced colours).
67
+ - **Reduced motion**: nothing travels ([motion.md](motion.md)).
68
+ - **Increase contrast** (`prefers-contrast: more`, macOS and others): not
69
+ answered yet. Write no rule for it; it may later take the contrast block
70
+ without the contrast palette ([known-gaps.md](known-gaps.md)).
71
+
72
+ ## Contrast and forced colours
73
+
74
+ **Forced colours belong to the operating system, never to a page:** a page
75
+ can't turn them on. **The contrast theme belongs to a host:** Teams reports
76
+ `contrast` without forcing anything (seen on a Mac), so a page in it has to
77
+ draw high contrast itself.
78
+
79
+ Both are drawn from one place, the **contrast block**, which `alisx.css`
80
+ carries twice, once for each, so they never drift apart. It does what high contrast
81
+ needs and colour alone can't:
82
+
83
+ - **An edge where light and dark use a shadow or a fill**: floating surfaces,
84
+ cards, alerts, the ask, a filled button, a progress track, a skeleton.
85
+ - **Selected is the selection slot**, with its own ink and the weight kept
86
+ ([selection.md](selection.md): two properties).
87
+ - **Focus has a slot of its own**, and on something selected takes the
88
+ selection's ink, so the ring never sits on its own colour.
89
+ - **Checked controls** (a checkbox, a radio, a switch) and a progress fill keep
90
+ their marks, which the system would otherwise erase.
91
+
92
+ The block names colours only through its slots, which `make generate` checks.
93
+ Under forced colours each slot is a system colour (`CanvasText`, `Highlight` …);
94
+ under the contrast theme each is a value in `tokens.json` § hostThemes.
95
+
96
+ **The contrast theme** is a few slots, and every product role is assigned one:
97
+ a black ground; white ink, edges and selection; the dark theme's action cyan for
98
+ the filled action, links and focus; a light red for errors and destructive
99
+ actions; Alis red for the mark. Categories, statuses other than error, and
100
+ syntax collapse to ink: a state says itself in words and an icon
101
+ ([chips-alerts.md](chips-alerts.md)). So a chart's series lose their colours in
102
+ contrast ([known-gaps.md](known-gaps.md)).
103
+
104
+ - **On `<html>` only, on screen only.** Print stays light.
105
+ - **Forced colours win.** When the operating system forces colours, the
106
+ contrast theme stands down and the system's colours draw the block.
107
+ - **Machine speech** keeps its edge and takes the contrast values: it doesn't
108
+ stay dark on a black page.
109
+ - **Client branding drops away**: brand role overrides don't apply in contrast
110
+ or under forced colours; a logo stays, on a transparent ground
111
+ ([branding.md](branding.md)).
112
+ - **The console never shows contrast.** It has no host to ask for it.
113
+
33
114
  ## Client branding
34
115
 
35
116
  A client-facing portal may override a bounded set of roles through a scoped,
@@ -73,7 +154,7 @@ other rules hold in both themes:
73
154
 
74
155
  ## What doesn't change, and why
75
156
 
76
- | Role | Same in both themes because |
157
+ | Role | The same in light and dark because |
77
158
  | --- | --- |
78
159
  | `signal` | It is the Alis mark. Alis looks the same in either theme. |
79
160
  | `cat1`–`cat6` | A series is the same colour wherever its chart is. Violet and rose are a small step lighter in dark, so they clear 3:1 on a dark card; the rest are identical. |
@@ -118,5 +199,11 @@ a theme change needs no re-highlight.
118
199
  3. `product.css` names roles only: no literal colour, no palette or narrative
119
200
  token. A deliberate exception says why on its line: `/* any-theme: … */`.
120
201
 
202
+ 4. The contrast block names colours only through its slots, and every slot it
203
+ names has a value in the contrast theme.
204
+ 5. Every product role has a contrast slot, and the contrast pairs in
205
+ `tokens.json` § hostThemes pass: 7:1 for text, 4.5:1 for edges and focus,
206
+ 3:1 for a filled action and the mark against the ground.
207
+
121
208
  What it can't see: a `color-mix` fill, a library's internals, your own CSS.
122
- **Look at every new component in both themes** before it ships.
209
+ **Look at every new component in both themes** before it ships, and once under forced colours (a browser's developer tools can emulate them).
package/tokens.css CHANGED
@@ -152,6 +152,7 @@
152
152
  --measure-prose: 710px;
153
153
  --nav-width: 256px;
154
154
  --detail-width: 360px;
155
+ --card-min-width: 320px;
155
156
  --breakpoint-compact: 600px;
156
157
  --breakpoint-medium: 840px;
157
158
  --breakpoint-expanded: 1200px;
@@ -367,3 +368,85 @@
367
368
  /* Rules on the tokens themselves, shipped in alisx.css and tokens.css alike. */
368
369
  @media (pointer: coarse) { :root { --touch-target: var(--touch-target-coarse); --control-height: var(--touch-target-coarse); } }
369
370
  @media (prefers-reduced-motion: reduce) { :root { --dur-tint: 0ms; --dur-ui: 0ms; --dur-panel: 0ms; --dur-arrive: 0ms; --stagger: 0ms; } }
371
+
372
+ /* Host theme "contrast": only where a host profile maps to it, on <html> only, never in print (rules/themes.md § Contrast and forced colours). */
373
+ @media screen and (forced-colors: none) {
374
+ :root[data-theme="contrast"] {
375
+ color-scheme: dark;
376
+ --primary: #7fd4e8;
377
+ --on-primary: #000000;
378
+ --signal: #f02222;
379
+ --on-surface: #ffffff;
380
+ --on-surface-variant: #c4cbd0;
381
+ --background: #000000;
382
+ --surface: #000000;
383
+ --surface-container-low: #000000;
384
+ --surface-container-high: #000000;
385
+ --surface-container-highest: #000000;
386
+ --surface-variant: #000000;
387
+ --shimmer: #000000;
388
+ --secondary-container: #ffffff;
389
+ --on-secondary-container: #000000;
390
+ --selection-chrome: #ffffff;
391
+ --outline: #ffffff;
392
+ --field-edge: #ffffff;
393
+ --field-edge-hover: #ffffff;
394
+ --outline-variant: #ffffff;
395
+ --error: #ffb4ab;
396
+ --on-error: #000000;
397
+ --warning: #ffffff;
398
+ --success: #ffffff;
399
+ --info: #ffffff;
400
+ --inverse-surface: #ffffff;
401
+ --on-inverse-surface: #000000;
402
+ --code-surface: #000000;
403
+ --machine-surface: #000000;
404
+ --on-machine-surface: #ffffff;
405
+ --paper: #ffffff;
406
+ --scrim: #000000;
407
+ --shadow-key: transparent;
408
+ --glass-rim: transparent;
409
+ --glass-edge: #ffffff;
410
+ --glass-grid: transparent;
411
+ --shadow-ambient: transparent;
412
+ --highlight: #ffffff;
413
+ --on-highlight: #000000;
414
+ --cat1: #ffffff;
415
+ --cat2: #ffffff;
416
+ --cat3: #ffffff;
417
+ --cat4: #ffffff;
418
+ --cat5: #ffffff;
419
+ --cat6: #ffffff;
420
+ --on-cat: #000000;
421
+ --cat1-container: #000000;
422
+ --cat2-container: #000000;
423
+ --cat3-container: #000000;
424
+ --cat4-container: #000000;
425
+ --cat5-container: #000000;
426
+ --cat6-container: #000000;
427
+ --on-cat1-container: #ffffff;
428
+ --on-cat2-container: #ffffff;
429
+ --on-cat3-container: #ffffff;
430
+ --on-cat4-container: #ffffff;
431
+ --on-cat5-container: #ffffff;
432
+ --on-cat6-container: #ffffff;
433
+ --chart-neutral: #c4cbd0;
434
+ --syntax-plain: #ffffff;
435
+ --syntax-comment: #c4cbd0;
436
+ --syntax-keyword: #ffffff;
437
+ --syntax-string: #ffffff;
438
+ --syntax-number: #ffffff;
439
+ --syntax-function: #ffffff;
440
+ --ai-you: #ffffff;
441
+ --ai-you-container: #000000;
442
+ --ai-alis: #f02222;
443
+ --ai-alis-container: #000000;
444
+ --ai-tail: #ffffff;
445
+ --ai-ground-start: #000000;
446
+ --ai-ground-end: #000000;
447
+ --field-grid-line: transparent;
448
+ --field-glow-1: transparent;
449
+ --field-glow-2: transparent;
450
+ --field-noise: transparent;
451
+ }
452
+ }