oficina / estilo Public

Clone
git clone https://amadan.net/oficina/estilo

Plain git — no account needed to clone.

Download

Download this file

1# Estilo
2
3Estilo is the CARLOS suite's shared design system, at
4`amadan.net/oficina/estilo.git`. It's a public Go module under the
5Mozilla Public License 2.0 (`LICENSE`).
6
7`theme` is Calma, the suite's look (AGENTS.md, "Theme"): `theme.CSS()` is
8the suite's theme and `theme.ForApp(slug)` an app's, with its accent from
9the colour ring in `theme/apps.go`. The chrome is set in
10the system UI face and downloads no font (AGENTS.md row 9);
11`theme.FontHandler` only keeps the retired Onest files of `fonts/v1/`
12answering for old pages, and nothing should link them. `brand` holds the marks,
13and `sky` the seeded nebula for the sign-in, the team's home and the front
14page — never inside an app.
15
16`savestatus` is a save-status indicator, already adopted by Docs and
17Slides. It renders state (saved, saving, retrying, failed) inside a
18polite status region for screen readers; callers supply the localized
19message text for each state.
20
21`homeconnect` holds templates and data for Home account-connection and
22OAuth screens, being adopted by the shared home/connect flow and other
23apps. It carries no authentication logic — callers validate the
24destination and supply translated labels. The screens run without
25scripts.
26
27`base`, `menu` and `chrome` are the shared chrome from the round-2 spec
28(`docs/superpowers/specs/2026-09-23-shared-chrome.md` on
29`spec/shared-chrome`): link styling; the one floating menu panel and the
30document menu bar, with `menu.Shortcut` for platform-correct shortcut
31labels; and the top bar, account menu, app switcher, error page and
32sign-in pages, with the per-app Appearance preference. Link the three
33stylesheets in that order, after `tokens.css`, the theme and
34`brand.css`. `brand` serves the app icons from Go. Docs adopted first and
35Sheets second, and Sheets' corrections are in: a menu row or bar action
36can be a link, a POST (`menu.Item.Action`) or a dialog opened by the
37platform's invoker command (`menu.Item.Dialog`); `Bar.Actions` is
38`[]chrome.Action`; `<div estilo-shell="fill">` is the full-height layout
39(the viewport less the 52px bar); and `chrome.js` closes every member of
40the one `estilo-menus` group, menubar menus included, on Escape (in the
41capture phase) and an outside click.
42
43Docs' I2 editor added two slots to `chrome.Bar` (spec
44`docs/superpowers/specs/2026-11-11-editor-i2-design.md` in Docs).
45`Menubar` takes the app's own `estilo-menubar` markup and makes the bar
46stacked (`estilo-bar~="stacked"`): from 800px a 56px header with the title
47over the menus, below it the one-row bar with the menus as a second row;
48`--estilo-bar-block-size` is published either way. `Lead` takes app markup
49for the start of the end group (Docs' undo/redo), which the app must hide
50on narrow screens itself. A bar with either slot
51draws its end group as one set of controls; a bar with neither is
52unchanged, byte for byte. `Action.WideOnly` hides an action below 64rem
53and keeps it out of the Menu sheet, and `menu.Item.Controls` is a toggle
54(`aria-expanded`, `aria-controls`, disabled until the app binds it). The
55account menu's Appearance is a three-way segmented selector that
56`chrome.js` switches in place.
57
58Docs' phone web design (Paul, 2026-11-28) added `Bar.Compact`
59(`estilo-bar~="compact"`): below 704px, or on a phone held sideways, the
60bar is one 52px row of Back (the brand: a chevron and the app's name),
61the title, the lead and the app's `Compact.Trail` (Docs' Aa and •••); the
62menu row, the actions, the switcher and the account are not shown there,
63and the Menu sheet is drawn only for `Nav`. From 704px a compact stacked
64bar is the 56px header, which every other stacked bar keeps from 800px
65(Mapa's and Fichas' layouts change there); the 704px band is a copy of
66the header's rules that `CSS()` makes, scoped to a compact bar. `Compact.Title` replaces
67the bar's title for a page with a large title of its own: it shows once
68the app's script sets `estilo-bar-folded` on the header. In the trail,
69`[estilo-bar-tool]` is a 44px round control and a `<details>` panel is a
70drop-down from the bar's inline end with 44px rows. `menu.Item.Icon`
71draws a glyph before a row's label. On a coarse pointer, in every app,
72the bar's triggers, the rail's account row, every menu row and every
73menubar title are 44px, and where nothing hovers
74menus show no shortcut hints. `savestatus` takes a third placement,
75`subtitle`, for the state under a large title.
76
77The smart door (spec `docs/superpowers/specs/2026-11-19-smart-door.md` in
78Home, step 2) is `estilo-signin-screen` with `chrome.SignInScreen`:
79rastrillo's sign-in screen, its ui `signin` partial (the remembered way
80in, Other ways to sign in and the chooser), drawn inside the door, with
81the sky behind and the app's mark and name at the card's head. It is
82duck-typed, because estilo pins the old rastrillo path: the app passes its
83`auth.SigninState` and `*ui.Localizer` as `State` and `L`, and parses its
84own rastrillo's `ui.Templates()` alongside estilo's. With
85`State.Unavailable` it draws nothing. `chrome.OficinaGlyph` is the icon for
86the Oficina ID door (`auth.FederatedDoor.Icon`), and
87`SignInNotice.Forgetting` adds "Forget me on this device" to the
88signed-out page. `estilo-signin` stays for apps that haven't moved; the
89door carries no footer links.
90
91`desk` is the grey desk an editor sits on (`--estilo-desk`), the floating
92glass card (`estilo-card`), the inspector built on it (`estilo-inspector`,
93with `estilo-inspector-group` and `estilo-inspector-label`) and the
94segmented control (`estilo-seg`, `estilo-seg-item`: a button with
95`aria-pressed`, or a label around a radio or checkbox). The values are
96Docs' own, copied; Slides is the first other app to use them. It is styling
97only, so it works with scripts off; the app places the card.
98
99`side` is an app's side panel, Mapa's, moved here when Contra became
100its second user. `<div estilo-side-frame>` puts `nav[estilo-side]` under
101the bar, beside `<main>`; its rows are `estilo-side-item` (an icon,
102`estilo-side-label`, an optional `kbd[estilo-side-key]`), page rows sit
103under `estilo-side-head` headings, and `estilo-side-foot` is pinned to
104the bottom with the fold. The fold turns the side into a rail of icons,
105with the labels as tooltips: from 80rem it is open unless folded, below
106that a rail, and below 800px it is gone, because its places are in the
107bar's Menu sheet. The fold is a form, so it works with scripts off
108(`side.SetState` keeps it in the app's cookie); `side.js` folds in place
109and adds ⌘\. Link `side.css` after `chrome.css`.
110
111`colophon` is the suite's Colophon, reached from Help: every open-source
112project an app is made with, in sections (typefaces, libraries by
113runtime, icons and artwork, data, tools), each with a sentence or two on
114what it is and what the app uses it for, who made it, its licence (linked
115to the text the app serves) and its home and source. `projects.json` is
116the one catalog of those words, so every app describes Yjs the same way.
117An app never lists projects by hand: it collects what it ships (Go
118modules through `credits/catalog`, npm packages from esbuild's metafile
119with `CollectNPM`, crates from `cargo metadata` with `CollectCargo`, plus
120its fonts and vendored files) and `colophon.Build` refuses a package the
121catalog does not know, a usage note for something no longer shipped, or a
122shipped package without its licence text. No script, no webfont. Docs
123adopted first.
124
125Permission and session logic stay app-owned. There is no
126shared component gallery yet.
127
128## Building
129
130`make test` is the gate: a module-cache check (`go mod verify`, re-fetching
131anything damaged), `go vet`, a `gofmt` check, `go build`, then `go test`. `savestatus`'s own tests run under Node.
132
133## Licence
134
135Estilo is licensed under the Mozilla Public License 2.0; see `LICENSE`.
136The licence covers the code, styles and artwork in this repository. It
137does not grant rights in the Oficina, CARLOS or app names, or permission
138to present a modified build as the suite (MPL-2.0 section 2.3).
139Third-party parts keep their own licences: Lucide (`brand/LICENSE.lucide`)
140and Onest (`credits/notices/onest-OFL.txt`).
141