Skip to content

Commit 7349789

Browse files
committed
feat(system): import unified theme design pass
1 parent 0960f8d commit 7349789

47 files changed

Lines changed: 3599 additions & 3952 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

scripts/smoke-static.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import process from "node:process";
33

44
const port = Number(process.env.PORT ?? String(4200 + Math.floor(Math.random() * 1000)));
55
const baseUrl = `http://127.0.0.1:${port}`;
6-
const paths = ["/", "/design-system.html", "/design-system-light.html", "/tokens.css", "/preview/web-shell.html"];
6+
const paths = ["/", "/design-system.html", "/design-system.html?theme=light", "/design-system-light.html", "/tokens.css", "/preview/web-shell.html"];
77

88
function wait(ms: number) {
99
return new Promise((resolve) => setTimeout(resolve, ms));
@@ -32,7 +32,8 @@ async function smokePath(pathname: string) {
3232
}
3333

3434
const text = await response.text();
35-
if (pathname.endsWith(".html") || pathname === "/") {
35+
const cleanPathname = pathname.split("?", 1)[0] ?? pathname;
36+
if (cleanPathname.endsWith(".html") || cleanPathname === "/") {
3637
if (!text.includes("put.io")) {
3738
throw new Error(`${pathname} did not include the expected put.io marker`);
3839
}

system/README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ This is the `system/` folder inside [`putdotio/putio-design`](https://github.com
88
project root/
99
└── system/
1010
├── index.html ← redirects to the design-system guide
11-
├── design-system.html ← dark-mode guide and preview-card index
12-
├── design-system-light.html
11+
├── design-system.html ← guide and preview-card index
12+
├── design-system-light.html ← legacy redirect to design-system.html?theme=light
1313
├── tokens.css ← generated from ../tokens/**/*.tokens.json
1414
├── assets/ ← logos, favicons, retro marks, app icons
1515
└── preview/ ← atomic review cards for foundations + components + brand + platforms
@@ -49,11 +49,23 @@ For **TV preview cards**, also load `preview/tv-shell.css` — it adds the `.tv`
4949

5050
## Core rules
5151

52-
- **Yellow `#FDCE45` is sacred.** Never gradient, tint, or replace. Primary CTAs, folder icons, focus rings (at 35% alpha), progress bars.
52+
- **Yellow `#FDCE45` is sacred.** Never gradient, tint, or replace. Primary CTAs, folder icons, focus rings (at 35% alpha), progress bars. `--yellow-solid` is the brand value; for yellow text on light backgrounds use `--yellow-text-secondary` instead.
5353
- **Icons: Phosphor-style inline SVG.** No emoji, ever.
54-
- **Dark is app-default, light is landing-default.** Both are in tokens; toggle with `.dark` on `<html>`.
54+
- **One design, two modes.** Light and dark are the same markup and components with different token values. Toggle `.dark` on `<html>`; do not fork the page or rebuild a light-specific copy.
5555
- **Content-agnostic.** put.io doesn't know what the user's files are. Never parse `The.Wire.S03E04.1080p.mkv` into `The Wire`. Raw filenames only. See the root [`DESIGN.md`](../DESIGN.md) for the full principle.
5656

57+
## Theme System
58+
59+
The guide owns the theme toggle. It stores `putio-ds-theme` in `localStorage`,
60+
updates `html.dark`, and broadcasts the current mode to embedded preview iframes.
61+
Standalone preview pages read the same storage key before paint. A URL query
62+
(`?theme=light` or `?theme=dark`) can override the preview mode for screenshots.
63+
64+
Fixed-mode previews opt out with `<html data-theme-lock="dark">`. This is only
65+
for product mockups whose visual language is intrinsically one mode, such as TV
66+
and mobile shell specimens. Component previews should stay token-driven and work
67+
in both modes.
68+
5769
## Design variants
5870

5971
Four documented type stacks — pick one per surface:

0 commit comments

Comments
 (0)