jsonresume-theme-wintermuted 0.1.0 → 0.1.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/README.md CHANGED
@@ -2,17 +2,25 @@
2
2
 
3
3
  Open-source JSON Resume theme extracted from the private CV repository.
4
4
 
5
+ ## Preview
6
+
7
+ These screenshots use the bundled Alex Winter sample resume rendered with this theme.
8
+
9
+ ### Summary And Experience
10
+
11
+ ![Alex Winter summary and experience preview](examples/screenshots/alex-winter-summary.png)
12
+
13
+ ### Projects
14
+
15
+ ![Alex Winter projects preview](examples/screenshots/alex-winter-projects.png)
16
+
5
17
  ## Install
6
18
 
7
19
  ```bash
8
20
  npm install jsonresume-theme-wintermuted
9
21
  ```
10
22
 
11
- Also install the shared design-token package used by this theme:
12
-
13
- ```bash
14
- npm install @wintermuted/ui-theme
15
- ```
23
+ The shared `@wintermuted/ui-theme` package is installed automatically as a dependency of this theme.
16
24
 
17
25
  For local development before publish:
18
26
 
@@ -26,13 +34,192 @@ npm install ../jsonresume-theme-wintermuted
26
34
  resumed render resume.json -t jsonresume-theme-wintermuted -o resume.html
27
35
  ```
28
36
 
37
+ Project screenshots declared in `resume.json` are inlined automatically when `src` points to a local image file. Relative paths are resolved from the directory where you run `resumed render`, which keeps exported HTML self-contained for local viewing, GitHub Pages, and other static hosts.
38
+
39
+ ## Scripts
40
+
41
+ The package includes these local preview scripts:
42
+
43
+ - `npm run preview:render` renders `examples/resume.sample.json` to `examples/preview.html`
44
+ - `npm run preview:serve` serves the repository at `http://localhost:4175/`
45
+ - `npm run preview:open` opens `http://localhost:4175/examples/preview.html`
46
+ - `npm run preview:view` renders the sample, ensures a local server is available, and opens the preview page
47
+
48
+ ## Local Viewing
49
+
50
+ This repository includes a sample resume payload for quickly previewing theme changes.
51
+
52
+ ```bash
53
+ npm run preview:render
54
+ npm run preview:serve
55
+ npm run preview:open
56
+ ```
57
+
58
+ `preview:render` uses the local theme renderer (`index.js`) directly, so it works in this repository without publishing or npm linking.
59
+
60
+ Recommended local preview flow:
61
+
62
+ 1. Run `npm run preview:render` after changing templates, helpers, or CSS.
63
+ 2. Run `npm run preview:serve` to start the local preview server.
64
+ 3. Run `npm run preview:open` to open the rendered sample resume.
65
+ 4. Use `npm run preview:view` when you want the render, server check, and open steps handled for you.
66
+
67
+ Files:
68
+
69
+ - `examples/resume.sample.json`
70
+ - `examples/preview.html` (generated)
71
+
72
+ You can also run:
73
+
74
+ ```bash
75
+ npm run preview:view
76
+ ```
77
+
78
+ This renders the sample and starts a local server on `http://localhost:4175/`.
79
+ If a preview server is already running on that port, the script reuses it and opens the preview page.
80
+
81
+ ## Browser regression gate
82
+
83
+ **CI Build** also runs the actual `render()` output with embedded shared/local CSS
84
+ in Chromium using Playwright **1.58.2**, inside
85
+ `mcr.microsoft.com/playwright:v1.58.2-noble` on an `ubuntu-24.04` runner.
86
+ The workflow also pins that image's observed SHA-256 digest and Node 20.20.2.
87
+ The npm/browser image versions must stay synchronized. This is a pinned
88
+ Playwright/Ubuntu userspace, not a cross-platform screenshot promise; the hosted
89
+ runner kernel/hardware and Actions implementations can still change.
90
+
91
+ The bounded matrix is 1280 x 900 desktop and 390 x 844 mobile emulation, each
92
+ with OS light/dark preference, at device scale 1, en-US and UTC. Fifteen committed
93
+ images cover summary, expanded experience and detailed media in all four cases,
94
+ plus focused/right desktop navigation and print from dark summary. Assertions
95
+ check actual visibility, disclosure ARIA/classes and view reset, persisted theme
96
+ and layout choices, section/subsection navigation, horizontal overflow, and
97
+ print overrides. Screenshots complement these assertions rather than replacing
98
+ them. The print button is observed via a `window.print` spy; print CSS is
99
+ emulated and an A4 PDF retained as pagination evidence, **not** a PDF comparison
100
+ or a test of the native print dialog.
101
+
102
+ `scripts/browser/server.mjs` renders the bundled Alex Winter sample directly,
103
+ adding work/project keywords, a linked work project, languages/interests and an
104
+ inline SVG image for representative tags and media. No production template,
105
+ styles or package version are altered for tests. Each test gets a fresh browser
106
+ context; persistence assertions reload within that context rather than seeding
107
+ the expected UI state.
108
+
109
+ Google Fonts CSS is replaced with an empty sheet: screenshots exercise the
110
+ pinned Linux system-font fallback, not downloaded Inter. The external Mermaid
111
+ module gets an initialization-only stub whose render method throws if invoked;
112
+ the fixture contains no Mermaid diagrams. Other external requests and browser
113
+ script errors fail. This does **not** verify CDN availability, real Mermaid,
114
+ remote project assets, Firefox/WebKit, physical phones, accessibility compliance,
115
+ Game of Life, or animation timing. Decorative randomness is seeded without
116
+ removing its DOM. Reduced motion is requested, and Playwright finishes CSS
117
+ animations/transitions during screenshots; real scroll listeners and smooth
118
+ navigation still execute. There are no broad element masks or visibility fixes.
119
+ Full-page captures include the real fixed viewport-sized tile background:
120
+ the change of background below the initial viewport is existing behavior.
121
+ The print baseline also preserves existing dark shared accent tags rather than
122
+ changing production CSS to make them white.
123
+
124
+ ### Reviewing and changing baselines
125
+
126
+ The initial fifteen baselines were observed and visually reviewed from
127
+ [CI capture 46321519427](https://github.com/wintermuted/jsonresume-theme-wintermuted/actions/runs/46321519427)
128
+ at renderer/test revision `29c1b8c4445602807f453815d9e17a410292bf69`:
129
+ Ubuntu 24.04.3 LTS, Node 20.20.2, Chromium 145.0.7632.6. Its capture and
130
+ subsequent strict comparison both passed (six cases, six matrix exclusions).
131
+ The first proof-runner rejected the missing image correctly but then failed on
132
+ its own wording check; that check was corrected to Playwright's observed error.
133
+ The committed images must also pass an ordinary **no-capture** CI run.
134
+
135
+ `npm run test:browser` defaults to **no updates**, locally and in CI. Missing
136
+ baselines fail without being written; changed screenshots fail at zero differing
137
+ pixels after Playwright's per-pixel 0.2 color threshold. No retries are used.
138
+ Never use a Windows/macOS run to bless the Linux baselines.
139
+
140
+ For an intentional visual change, manually dispatch **CI Build** on the branch
141
+ with `capture_baselines=true`. That explicit step captures **candidates**, then
142
+ immediately reruns the no-update gate and failure probes on the same platform.
143
+ Download `browser-baseline-candidates`, review every affected PNG against the
144
+ intended change (and old expected/actual/diff images), and commit only the reviewed
145
+ files under `scripts/browser/baselines/`. Capture never commits or approves them.
146
+ Rerun normal CI with the input left false before merging. A capture-only run
147
+ does not establish that the committed baselines pass. Upgrading Playwright or
148
+ the image requires the same explicit review; don't bulk-accept unexplained diffs.
149
+
150
+ The `browser-results` artifact retains the HTML report, failed-test traces,
151
+ expected/actual/diff PNGs, print PDF and platform/revision evidence for 14 days,
152
+ including failed capture attempts. Open the downloaded HTML report with
153
+ Playwright's `show-report` command; inspect traces with `show-trace`.
154
+ `npm run test:browser:probes` deliberately changes heading size, disables a
155
+ disclosure click, exposes print controls, and selects nonexistent baselines.
156
+ It requires exactly one test failure at the intended assertion for each probe,
157
+ and retains separate JSON/HTML/trace evidence. Probe failures are expected;
158
+ a probe escaping the gate or failing for an unrelated reason fails the job.
159
+
160
+ ## GitHub Pages Publishing
161
+
162
+ This repository publishes a live preview of the sample resume through GitHub Pages using Actions.
163
+
164
+ - Pushes to `main` publish production content to the root Pages site.
165
+ - Pull requests to `main` publish isolated previews under `previews/pr-<number>/`.
166
+ - Closing a pull request removes its preview directory from `gh-pages`.
167
+
168
+ Workflows:
169
+
170
+ - `.github/workflows/deploy-pages.yml`
171
+ - `.github/workflows/cleanup-pr-preview.yml`
172
+
29
173
  ## What this package contains
30
174
 
31
175
  - `resume.hbs` main Handlebars template
32
176
  - `partials/` section partials
33
177
  - `helpers/` helper functions
34
178
  - `style.css` theme-specific styles
35
- - Runtime CSS token inlining from `@wintermuted/ui-theme`
179
+ - Runtime CSS embedding from `@wintermuted/ui-theme`
180
+
181
+ Toolbar controls, detail disclosures, keyword/project tags, and section navigation
182
+ use the shared `wm-btn-pill`, `wm-btn-expand`, `wm-tag`, `wm-tag-accent`, and
183
+ `wm-side-nav` classes. The local stylesheet owns resume layout, nested navigation,
184
+ view visibility, and print overrides; component appearance comes from the library.
185
+ Disclosure buttons keep `aria-expanded` synchronized with their visible details.
186
+
187
+ ### Shared CSS embedding
188
+
189
+ Static exports embed the pinned library's public `styles/tokens.css`,
190
+ `styles/base.css`, `styles/components/button.css`, `styles/components/tag.css`,
191
+ and `styles/components/side-nav.css`, in that order, followed by `style.css`.
192
+ The base sheet retains element resets, selection, table, and inline-code styles;
193
+ tokens retain both light and dark palettes. Unused component sheets are not embedded.
194
+ Resume layout, print overrides, galleries, and interactions remain application-owned.
195
+
196
+ Stylesheets resolve through Node's package exports, including installed local
197
+ directory dependencies and npm links with their own dependencies installed.
198
+ File URLs are decoded with Node's file URL utilities, including Windows drive
199
+ letters, spaces, and percent-encoded filenames. No legacy package names or
200
+ uninstalled sibling checkouts are searched.
201
+
202
+ The embedder expands local relative imports written as quoted strings or
203
+ `url(...)` (quoted or unquoted), including multiline directives and comments.
204
+ Imports must precede rules. Repeated imports retain their cascade order.
205
+ Missing required sheets, missing imports, and cycles throw contextual errors.
206
+ Conditional imports (media, supports, or layer), CSS-escaped import targets,
207
+ remote/protocol-relative URLs, and query/fragment targets fail explicitly:
208
+ they are not stripped, fetched, or inlined with altered semantics.
209
+ This does not change the template's existing external font and Mermaid resources.
210
+
211
+ ### Shared tokens
212
+
213
+ The pinned `@wintermuted/ui-theme` 0.21.3 package supplies `--wm-font-sans`
214
+ for body typography and `--wm-radius-base` (8px) for lightbox media. Local
215
+ color aliases already consume its text, background, surface, border, and link
216
+ tokens, while retaining print-specific colors and standalone fallbacks.
217
+
218
+ That package does not export spacing tokens. Resume spacing remains local,
219
+ as do the 3px navigation corners, 6px gallery corners, Game of Life styling,
220
+ and the dark navigation/gallery surface (`#1e1e1e`), which have no equivalent
221
+ shared token. Do not substitute approximate scale values or upgrade the
222
+ dependency solely to remove these local values.
36
223
 
37
224
  ## Publish
38
225
 
@@ -40,4 +227,107 @@ resumed render resume.json -t jsonresume-theme-wintermuted -o resume.html
40
227
  npm publish --access public
41
228
  ```
42
229
 
43
- If you publish through GitHub Actions, configure the workflow to run `npm publish` on tags.
230
+ Automated publishing uses npm trusted publishing (OIDC) from GitHub Actions.
231
+ The release job uses GitHub-hosted Ubuntu, Node 22, and explicitly installs
232
+ npm 11.6.4: [trusted publishing](https://docs.npmjs.com/trusted-publishers/)
233
+ requires npm >=11.5.1 and Node >=22.14.0. Node 22's bundled npm 10 cannot
234
+ authenticate using OIDC, even with `id-token: write` and `--provenance`.
235
+
236
+ Release flow:
237
+
238
+ 1. Merge or push changes to `main`.
239
+ 2. The `Publish And Release` workflow computes the next patch version from the latest `v*` tag.
240
+ 3. The workflow updates `package.json` and `package-lock.json`, creates a local version commit, and publishes the package to npm.
241
+ 4. It verifies the exact version's registry SHA-512 integrity against the local package, then pushes the version commit to `main`.
242
+ 5. The workflow creates and pushes the matching `v<version>` tag.
243
+ 6. The workflow creates the corresponding GitHub release.
244
+
245
+ No long-lived `NPM_TOKEN` secret is required. A package maintainer must verify
246
+ the npm package's **Settings > Trusted publishing** connection: GitHub user
247
+ `wintermuted`, repository `jsonresume-theme-wintermuted`, workflow filename
248
+ `publish-release.yml` (not its path), and no environment name (this job uses none).
249
+ The connection must allow direct `npm publish`, not just staging. An unvalidated
250
+ connection expires after two days; recreate it if expired. These private
251
+ package-side settings cannot be verified or repaired in repository code.
252
+
253
+ Only `main` runs the release job, including manual dispatches. Registry lookup
254
+ errors fail explicitly; only HTTP 404 means unpublished. An existing version is
255
+ skipped only when its SHA-512 integrity matches the local packed contents.
256
+ After publication (or a matching skip), verification must succeed before the
257
+ version commit, tag, or release is pushed. No credentials are tested with
258
+ `npm whoami`, which does not validate OIDC permissions.
259
+
260
+ After merging this repair, an authorized maintainer should verify the connection
261
+ and observe the next `main` release. Do not rerun a failed historical run: it
262
+ retains the old workflow. If publication succeeds but verification or a later
263
+ push fails, inspect npm metadata and GitHub refs before manually dispatching the
264
+ current workflow on `main`. Recovery can skip an identical published package;
265
+ a different package at that immutable version fails rather than producing a
266
+ misleading release. If the tag already exists but the GitHub release is missing,
267
+ reconcile that specific release manually; a new dispatch computes the next patch.
268
+ No live publication, tag/release mutation, or publishing rerun is needed for
269
+ development validation. `npm test` covers offline registry failures, integrity
270
+ mismatches, recovery, and the publication-before-marker ordering.
271
+
272
+ ## Shared theme dependency updates
273
+
274
+ `.github/workflows/update-ui-theme.yml` receives the library's
275
+ `repository_dispatch` event `ui-theme-release`, with `client_payload.version`
276
+ (canonical stable `major.minor.patch`) and `client_payload.release_tag`
277
+ (`ui-theme@<version>` or legacy `v<version>`). Prereleases, build metadata,
278
+ leading zeros, mismatched tags, and non-version input are rejected, matching
279
+ the upstream stable-release contract.
280
+
281
+ The receiver runs only code checked out from the repository's default branch.
282
+ It verifies the exact version, npm registry tarball, and SHA-512 integrity,
283
+ then uses npm with lifecycle scripts disabled in an isolated manifest/lockfile
284
+ copy. Only the exact theme pin and its corresponding lock entries may change.
285
+ It creates `dependencies/ui-theme-<version>` from the checked-out default-branch
286
+ commit and opens a PR; **even major upgrades require review and are never merged
287
+ automatically**. The renderer and current pin stay unchanged until that PR merges.
288
+
289
+ Equal/older versions are logged as skipped. Repeated events for an existing open
290
+ or closed PR are also logged as skipped, without overwriting reviewer edits or
291
+ reopening rejected updates. Branches without a matching PR are treated as
292
+ collisions, not force-pushed. A moving default branch, npm/network failure,
293
+ unsynchronized existing lockfile, or incidental dependency changes fail explicitly.
294
+ If a future library release introduces transitive dependencies or npm rewrites
295
+ unrelated lock entries, update those manually in a reviewed PR instead.
296
+
297
+ ### Permissions and rollout
298
+
299
+ - Merge this receiver and the CI workflow change to the default branch before
300
+ enabling the upstream recipient.
301
+ - In **Settings > Actions > General**, enable **Allow GitHub Actions to create
302
+ and approve pull requests**. The receiver checks this setting before creating
303
+ a branch; it does not approve reviews. The default read-only token setting can
304
+ remain: the update job requests `contents: write`, `pull-requests: write`, and
305
+ `actions: write` explicitly. Repository/organization policies must permit
306
+ these permissions and creation of the update branches.
307
+ - The upstream `wintermuted/wintermuted-ui` workflow must list this repository
308
+ and its existing `DOWNSTREAM_PAT` must have access to dispatch here (fine-grained
309
+ token: repository **Contents: write**; classic token: `repo`).
310
+ No downstream PAT, npm token, or new secret is required. Public npm reads
311
+ use `https://registry.npmjs.org`.
312
+ - PRs created with `GITHUB_TOKEN` do not trigger ordinary `pull_request` workflows.
313
+ The receiver explicitly dispatches **CI Build** on the new update branch
314
+ (`workflow_dispatch` is exempt from that suppression). It runs the usual
315
+ `npm ci`, module-load check, renderer/automation tests, and package-content check.
316
+ The workflow code initially comes from the trusted default branch, not the payload.
317
+ Inspect this branch run before merging. A dispatched run may not satisfy rules
318
+ requiring a `pull_request` event or a merge-ref check; a human must close/reopen
319
+ the PR to trigger normal PR CI and the Pages preview. No token workaround or
320
+ preview/deployment permissions are added to the receiver.
321
+ - If branch creation succeeds but PR creation fails, inspect the orphan branch
322
+ and create its PR manually (or delete that specific branch before retrying).
323
+ If CI dispatch fails after PR creation, run CI Build manually on the update
324
+ branch or human-close/reopen the PR. Repeated events deliberately do not
325
+ overwrite, reopen, or retrigger existing PRs.
326
+ - GitHub concurrency keeps one running and one pending receiver; bursts can
327
+ replace a pending event. There is no automatic retry or backfill. After rollout,
328
+ a library maintainer can re-dispatch an already published release using the
329
+ upstream workflow. No live/test dispatch is needed when developing the receiver.
330
+
331
+ `npm test` includes offline tests with fake npm and GitHub responses for payload
332
+ validation, publication failures, synchronized/preserved dependency files, version
333
+ ordering, repeated/closed PRs, branch collisions, permissions, and API failures.
@@ -0,0 +1,38 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+
4
+ const INLINE_CACHE = new Map();
5
+ const PASSTHROUGH_PREFIX = /^(?:[a-z]+:|\/\/|#)/i;
6
+ const MIME_TYPES = {
7
+ '.png': 'image/png',
8
+ '.jpg': 'image/jpeg',
9
+ '.jpeg': 'image/jpeg',
10
+ '.gif': 'image/gif',
11
+ '.webp': 'image/webp',
12
+ '.svg': 'image/svg+xml',
13
+ '.avif': 'image/avif',
14
+ };
15
+
16
+ export function assetSrc(src) {
17
+ if (typeof src !== 'string' || src.length === 0) return src;
18
+ if (PASSTHROUGH_PREFIX.test(src)) return src;
19
+
20
+ const cached = INLINE_CACHE.get(src);
21
+ if (cached) return cached;
22
+
23
+ const [cleanSrc] = src.split(/[?#]/, 1);
24
+ const absolutePath = path.isAbsolute(cleanSrc)
25
+ ? cleanSrc
26
+ : path.resolve(process.cwd(), cleanSrc);
27
+
28
+ if (!fs.existsSync(absolutePath)) return src;
29
+
30
+ const extension = path.extname(cleanSrc).toLowerCase();
31
+ const mimeType = MIME_TYPES[extension];
32
+ if (!mimeType) return src;
33
+
34
+ const buffer = fs.readFileSync(absolutePath);
35
+ const dataUrl = `data:${mimeType};base64,${buffer.toString('base64')}`;
36
+ INLINE_CACHE.set(src, dataUrl);
37
+ return dataUrl;
38
+ }
package/helpers/css.js ADDED
@@ -0,0 +1,131 @@
1
+ import fs from 'node:fs';
2
+ import path from 'node:path';
3
+ import { fileURLToPath, pathToFileURL } from 'node:url';
4
+
5
+ // Keep public entry points in the aggregate's cascade order, before local CSS.
6
+ const stylesheets = [
7
+ 'styles/tokens.css',
8
+ 'styles/base.css',
9
+ 'styles/components/button.css',
10
+ 'styles/components/tag.css',
11
+ 'styles/components/side-nav.css',
12
+ ];
13
+
14
+ export function sharedCss() {
15
+ return stylesheets.map(sheet => {
16
+ const specifier = `@wintermuted/ui-theme/${sheet}`;
17
+ let entry;
18
+ try {
19
+ entry = new URL(import.meta.resolve(specifier));
20
+ } catch (cause) {
21
+ throw new Error(`Cannot resolve required stylesheet "${specifier}"`, { cause });
22
+ }
23
+ return inlineCssImports(entry);
24
+ }).join('\n');
25
+ }
26
+
27
+ // Skip comments and strings without mistaking their contents for directives.
28
+ function skipLiteral(source, offset) {
29
+ if (source.startsWith('/*', offset)) {
30
+ const end = source.indexOf('*/', offset + 2);
31
+ if (end === -1) throw new Error('Unterminated CSS comment');
32
+ return end + 2;
33
+ }
34
+ const quote = source[offset];
35
+ if (quote !== '"' && quote !== "'") return offset;
36
+ for (let i = offset + 1; i < source.length; i++) {
37
+ if (source[i] === '\\') i++;
38
+ else if (source[i] === quote) return i + 1;
39
+ }
40
+ throw new Error('Unterminated CSS string');
41
+ }
42
+
43
+ function importEnd(source, offset) {
44
+ let parentheses = 0;
45
+ for (let i = offset; i < source.length; i++) {
46
+ const next = skipLiteral(source, i);
47
+ if (next !== i) {
48
+ i = next - 1;
49
+ continue;
50
+ }
51
+ if (source[i] === '(') parentheses++;
52
+ if (source[i] === ')') parentheses--;
53
+ if (source[i] === ';' && parentheses === 0) return i;
54
+ if (parentheses < 0 || source[i] === '{' || source[i] === '}') break;
55
+ }
56
+ throw new Error('Malformed CSS @import (expected a terminating semicolon)');
57
+ }
58
+
59
+ function withoutComments(source) {
60
+ let result = '';
61
+ for (let i = 0; i < source.length; i++) {
62
+ const next = skipLiteral(source, i);
63
+ if (next !== i) {
64
+ result += source.startsWith('/*', i) ? ' ' : source.slice(i, next);
65
+ i = next - 1;
66
+ } else {
67
+ result += source[i];
68
+ }
69
+ }
70
+ return result;
71
+ }
72
+
73
+ export function inlineCssImports(entry, ancestors = new Set()) {
74
+ const entryUrl = entry instanceof URL ? entry : pathToFileURL(path.resolve(entry));
75
+ if (entryUrl.protocol !== 'file:' || entryUrl.search || entryUrl.hash) {
76
+ throw new Error(`Only local file stylesheets without query or fragment are supported: ${entryUrl}`);
77
+ }
78
+ const entryPath = fileURLToPath(entryUrl);
79
+ let source;
80
+ let identity;
81
+ try {
82
+ identity = fs.realpathSync(entryPath);
83
+ source = fs.readFileSync(entryPath, 'utf8');
84
+ } catch (cause) {
85
+ throw new Error(`Cannot read required stylesheet "${entryPath}"`, { cause });
86
+ }
87
+ if (ancestors.has(identity)) {
88
+ throw new Error(`Circular CSS import at "${entryPath}"`);
89
+ }
90
+ const chain = new Set(ancestors).add(identity);
91
+ let output = '';
92
+ let start = 0;
93
+ let rulesStarted = false;
94
+
95
+ for (let i = 0; i < source.length; i++) {
96
+ const next = skipLiteral(source, i);
97
+ if (next !== i) {
98
+ if (!source.startsWith('/*', i)) rulesStarted = true;
99
+ i = next - 1;
100
+ continue;
101
+ }
102
+ if (!/^@import\b/i.test(source.slice(i, i + 8))) {
103
+ if (!/\s/.test(source[i])) rulesStarted = true;
104
+ continue;
105
+ }
106
+ if (rulesStarted) {
107
+ throw new Error(`CSS @import must precede all rules in "${entryPath}"`);
108
+ }
109
+ const end = importEnd(source, i + 7);
110
+ const statement = withoutComments(source.slice(i + 7, end)).trim();
111
+ const match = /^(?:"([^"]+)"|'([^']+)'|url\(\s*(?:"([^"]+)"|'([^']+)'|([^"'()\s]+))\s*\))$/i.exec(statement);
112
+ if (!match) {
113
+ throw new Error(`Unsupported CSS @import in "${entryPath}": ${statement}`);
114
+ }
115
+ const target = match.slice(1).find(value => value !== undefined);
116
+ // CSS escapes and conditional/layered imports need a full CSS parser.
117
+ // Reject them instead of changing their meaning or leaving network imports.
118
+ if (target.includes('\\') || target.startsWith('//') || /^[a-z][a-z\d+.-]*:/i.test(target)) {
119
+ throw new Error(`Unsupported CSS import target "${target}" in "${entryPath}"`);
120
+ }
121
+ const targetUrl = new URL(target, entryUrl);
122
+ try {
123
+ output += source.slice(start, i) + inlineCssImports(targetUrl, chain) + '\n';
124
+ } catch (cause) {
125
+ throw new Error(`Cannot inline CSS import "${target}" from "${entryPath}"`, { cause });
126
+ }
127
+ i = end;
128
+ start = end + 1;
129
+ }
130
+ return output + source.slice(start);
131
+ }
package/helpers/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { formatMonthYear, formatYear } from './date-helpers.js';
2
+ import { assetSrc } from './asset-src.js';
2
3
  import { nestedWork } from './nested-work.js';
3
4
  import { slugify, linkProjects } from './link-projects.js';
4
5
  import { projectsForRole, roleMetaSummary, positionsForProject, projectMetaSummary } from './projects-for-role.js';
@@ -7,6 +8,7 @@ import { projectsByCategory } from './projects-by-category.js';
7
8
  export default {
8
9
  MY: formatMonthYear,
9
10
  Y: formatYear,
11
+ assetSrc,
10
12
  nestedWork,
11
13
  slugify,
12
14
  linkProjects,
package/index.js CHANGED
@@ -2,6 +2,7 @@ import handlebars from 'handlebars';
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import helpers from './helpers/index.js';
5
+ import { sharedCss } from './helpers/css.js';
5
6
 
6
7
  /**
7
8
  * @param {object} resume
@@ -13,36 +14,7 @@ export function render(resume) {
13
14
  'utf-8'
14
15
  );
15
16
 
16
- // Prepend the shared wintermuted UI theme (CSS variables + component classes).
17
- // We inline nested @import directives so the exported HTML is fully self-contained.
18
- let wmCss = '';
19
- try {
20
- const wmCssUrl = import.meta.resolve('@wintermuted/ui-theme/index.css');
21
- wmCss = inlineCssImports(new URL(wmCssUrl)) + '\n';
22
- } catch {
23
- // import.meta.resolve can fail when the theme is loaded via a file: symlink chain
24
- // (e.g. file:./themes/jsonresume-theme-local). Walk up the directory tree as fallback.
25
- let dir = import.meta.dirname;
26
- for (let i = 0; i < 6; i++) {
27
- const candidate = path.join(dir, 'node_modules', '@wintermuted', 'ui-theme', 'index.css');
28
- if (fs.existsSync(candidate)) {
29
- wmCss = inlineCssImports(candidate) + '\n';
30
- break;
31
- }
32
- const parent = path.dirname(dir);
33
- if (parent === dir) break; // reached filesystem root
34
- dir = parent;
35
- }
36
-
37
- // Local sibling fallback for workspace-style checkouts:
38
- // /code/jsonresume-theme-wintermuted next to /code/wintermuted-ui-theme
39
- if (!wmCss) {
40
- const siblingCandidate = path.resolve(import.meta.dirname, '..', 'wintermuted-ui-theme', 'index.css');
41
- if (fs.existsSync(siblingCandidate)) {
42
- wmCss = inlineCssImports(siblingCandidate) + '\n';
43
- }
44
- }
45
- }
17
+ const wmCss = sharedCss() + '\n';
46
18
 
47
19
  const template = fs.readFileSync(
48
20
  path.join(import.meta.dirname, 'resume.hbs'),
@@ -80,19 +52,3 @@ export function render(resume) {
80
52
 
81
53
  return handlebars.compile(template)({ css: wmCss + css, resume, sections });
82
54
  }
83
-
84
- function inlineCssImports(entry, visited = new Set()) {
85
- const entryPath = entry instanceof URL ? new URL(entry).pathname : path.resolve(entry);
86
- if (visited.has(entryPath)) return '';
87
- visited.add(entryPath);
88
-
89
- const source = fs.readFileSync(entryPath, 'utf-8');
90
- const importRegex = /^\s*@import\s+url\(["']([^"']+)["']\)\s*;\s*$/gm;
91
-
92
- return source.replace(importRegex, (_full, importPath) => {
93
- if (/^https?:\/\//i.test(importPath)) return '';
94
- const nextPath = path.resolve(path.dirname(entryPath), importPath);
95
- if (!fs.existsSync(nextPath)) return '';
96
- return inlineCssImports(nextPath, visited);
97
- });
98
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsonresume-theme-wintermuted",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Wintermuted JSON Resume theme extracted from the CV project.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -32,7 +32,20 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
+ "scripts": {
36
+ "test": "node --test scripts/*.test.mjs",
37
+ "test:browser": "playwright test",
38
+ "test:browser:probes": "node scripts/browser/failure-probes.mjs",
39
+ "preview:render": "node ./scripts/preview-render.mjs",
40
+ "preview:serve": "python3 -m http.server 4175",
41
+ "preview:open": "open http://localhost:4175/examples/preview.html",
42
+ "preview:view": "node ./scripts/preview-view.mjs"
43
+ },
44
+ "devDependencies": {
45
+ "@playwright/test": "1.58.2"
46
+ },
35
47
  "dependencies": {
48
+ "@wintermuted/ui-theme": "0.21.3",
36
49
  "handlebars": "^4.7.8"
37
50
  }
38
51
  }
@@ -18,7 +18,7 @@
18
18
  {{#if courses.length}}
19
19
  <ul class="keywords">
20
20
  {{#each courses}}
21
- <li>{{ this }}</li>
21
+ <li class="wm-tag">{{ this }}</li>
22
22
  {{/each}}
23
23
  </ul>
24
24
  {{/if}}
@@ -8,7 +8,7 @@
8
8
  {{#if keywords.length}}
9
9
  <ul class="keywords">
10
10
  {{#each keywords}}
11
- <li>{{ this }}</li>
11
+ <li class="wm-tag">{{ this }}</li>
12
12
  {{/each}}
13
13
  </ul>
14
14
  {{/if}}
@@ -3,7 +3,7 @@
3
3
  <h2>Languages</h2>
4
4
  <ul class="keywords">
5
5
  {{#each resume.languages}}
6
- <li>{{ language }}{{#if fluency}} <em>({{ fluency }})</em>{{/if}}</li>
6
+ <li class="wm-tag"><span>{{ language }}{{#if fluency}} <em>({{ fluency }})</em>{{/if}}</span></li>
7
7
  {{/each}}
8
8
  </ul>
9
9
  </section>
@@ -27,20 +27,20 @@
27
27
  <span class="role-projects-label">Relevant Positions</span>
28
28
  <ul class="role-projects-list">
29
29
  {{#each positions}}
30
- <li><a href="#{{ id }}" class="project-ref">{{ label }}</a></li>
30
+ <li class="wm-tag-accent"><a href="#{{ id }}" class="project-ref">{{ label }}</a></li>
31
31
  {{/each}}
32
32
  </ul>
33
33
  </div>
34
34
  {{/if}}
35
35
  {{/with}}
36
36
 
37
- <button class="expand-toggle" aria-label="Expand details" type="button">Show details<span class="toggle-meta">{{{projectMetaSummary this}}}</span></button>
37
+ <button class="wm-btn wm-btn-expand expand-toggle" aria-expanded="false" aria-label="Expand details" type="button">Show details<span class="toggle-meta">{{{projectMetaSummary this}}}</span></button>
38
38
  <div class="detail-content">
39
39
  {{#if images.length}}
40
40
  <div class="project-gallery">
41
41
  {{#each images}}
42
42
  <figure class="project-screenshot">
43
- <img src="../../{{ src }}" alt="{{ alt }}" loading="lazy" />
43
+ <img src="{{assetSrc src}}" alt="{{ alt }}" loading="lazy" />
44
44
  {{#if caption}}<figcaption>{{ caption }}</figcaption>{{/if}}
45
45
  </figure>
46
46
  {{/each}}
@@ -75,7 +75,7 @@
75
75
  {{#if keywords.length}}
76
76
  <ul class="keywords">
77
77
  {{#each keywords}}
78
- <li>{{ this }}</li>
78
+ <li class="wm-tag">{{ this }}</li>
79
79
  {{/each}}
80
80
  </ul>
81
81
  {{/if}}
@@ -104,13 +104,13 @@
104
104
 
105
105
  {{#if description}}<p>{{ description }}</p>{{/if}}
106
106
 
107
- <button class="expand-toggle" aria-label="Expand details" type="button">Show details<span class="toggle-meta">{{{projectMetaSummary this}}}</span></button>
107
+ <button class="wm-btn wm-btn-expand expand-toggle" aria-expanded="false" aria-label="Expand details" type="button">Show details<span class="toggle-meta">{{{projectMetaSummary this}}}</span></button>
108
108
  <div class="detail-content">
109
109
  {{#if images.length}}
110
110
  <div class="project-gallery">
111
111
  {{#each images}}
112
112
  <figure class="project-screenshot">
113
- <img src="../../{{ src }}" alt="{{ alt }}" loading="lazy" />
113
+ <img src="{{assetSrc src}}" alt="{{ alt }}" loading="lazy" />
114
114
  {{#if caption}}<figcaption>{{ caption }}</figcaption>{{/if}}
115
115
  </figure>
116
116
  {{/each}}
@@ -145,7 +145,7 @@
145
145
  {{#if keywords.length}}
146
146
  <ul class="keywords">
147
147
  {{#each keywords}}
148
- <li>{{ this }}</li>
148
+ <li class="wm-tag">{{ this }}</li>
149
149
  {{/each}}
150
150
  </ul>
151
151
  {{/if}}
@@ -8,7 +8,7 @@
8
8
  {{#if keywords.length}}
9
9
  <ul class="keywords">
10
10
  {{#each keywords}}
11
- <li>{{ this }}</li>
11
+ <li class="wm-tag">{{ this }}</li>
12
12
  {{/each}}
13
13
  </ul>
14
14
  {{/if}}
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
  {{#if position}}<p class="position">{{ position }}</p>{{/if}}
16
16
  {{#if summary}}<p>{{ summary }}</p>{{/if}}
17
- <button class="expand-toggle" aria-label="Expand details" type="button">Show details</button>
17
+ <button class="wm-btn wm-btn-expand expand-toggle" aria-expanded="false" aria-label="Expand details" type="button">Show details</button>
18
18
  <div class="detail-content">
19
19
  {{#if highlights.length}}
20
20
  <ul class="highlights">
package/partials/work.hbs CHANGED
@@ -29,7 +29,7 @@
29
29
  {{#if _shortSummary}}<p class="role-summary role-summary--short">{{ _shortSummary }}</p>{{/if}}
30
30
  {{#if summary}}<p class="role-summary role-summary--full">{{ summary }}</p>{{/if}}
31
31
 
32
- <button class="expand-toggle" aria-label="Expand details" type="button">Show details<span class="toggle-meta">{{{roleMetaSummary ../name startDate endDate @root.resume.projects keywords}}}</span></button>
32
+ <button class="wm-btn wm-btn-expand expand-toggle" aria-expanded="false" aria-label="Expand details" type="button">Show details<span class="toggle-meta">{{{roleMetaSummary ../name startDate endDate @root.resume.projects keywords}}}</span></button>
33
33
  <div class="detail-content">
34
34
  {{#if highlights.length}}
35
35
  <ul class="highlights">
@@ -44,7 +44,7 @@
44
44
  <span class="role-projects-label">Key Projects</span>
45
45
  <ul class="role-projects-list">
46
46
  {{#each this}}
47
- <li><a href="#project-{{slugify name}}" class="project-ref">{{ name }}</a></li>
47
+ <li class="wm-tag-accent"><a href="#project-{{slugify name}}" class="project-ref">{{ name }}</a></li>
48
48
  {{/each}}
49
49
  </ul>
50
50
  </div>
@@ -55,7 +55,7 @@
55
55
  <span class="role-projects-label">Skills</span>
56
56
  <ul class="keywords">
57
57
  {{#each keywords}}
58
- <li>{{ this }}</li>
58
+ <li class="wm-tag">{{ this }}</li>
59
59
  {{/each}}
60
60
  </ul>
61
61
  </div>
package/resume.hbs CHANGED
@@ -27,17 +27,17 @@
27
27
  <p class="label">{{ label }}</p>
28
28
  </div>
29
29
  <div class="controls">
30
- <button class="print-btn" aria-label="Print resume" type="button" onclick="window.print()">&#9113; Print</button>
31
- <button class="view-toggle" aria-label="Toggle view" type="button">
30
+ <button class="wm-btn-pill print-btn" aria-label="Print resume" type="button" onclick="window.print()">&#9113; Print</button>
31
+ <button class="wm-btn-pill view-toggle" aria-label="Toggle view" type="button">
32
32
  <span class="control-icon" aria-hidden="true">&#9776;</span>
33
33
  <span class="control-label">Summary</span>
34
34
  </button>
35
- <button class="nav-pos-toggle" aria-label="Toggle nav position" type="button">Nav &#8594;</button>
36
- <button class="layout-mode-toggle" aria-label="Toggle layout width" type="button">
35
+ <button class="wm-btn-pill nav-pos-toggle" aria-label="Toggle nav position" type="button">Nav &#8594;</button>
36
+ <button class="wm-btn-pill layout-mode-toggle" aria-label="Toggle layout width" type="button">
37
37
  <span class="control-icon" aria-hidden="true">&#x26F6;</span>
38
38
  <span class="control-label">Full Width</span>
39
39
  </button>
40
- <button class="theme-toggle" aria-label="Toggle dark mode" type="button">
40
+ <button class="wm-btn-pill theme-toggle" aria-label="Toggle dark mode" type="button">
41
41
  <span class="icon-moon">&#9790;</span>
42
42
  <span class="icon-sun">&#9788;</span>
43
43
  </button>
@@ -99,6 +99,11 @@
99
99
  var next = html.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';
100
100
  html.setAttribute('data-theme', next);
101
101
  localStorage.setItem('theme', next);
102
+ if (typeof window.refreshMermaidTheme === 'function') {
103
+ window.refreshMermaidTheme();
104
+ } else {
105
+ window.__mermaidThemePending = true;
106
+ }
102
107
  });
103
108
 
104
109
  /* --- Detailed / Summary view --- */
@@ -129,9 +134,17 @@
129
134
  });
130
135
  document.querySelectorAll('.expand-toggle.expanded').forEach(function (el) {
131
136
  el.classList.remove('expanded');
137
+ el.setAttribute('aria-expanded', 'false');
132
138
  el.firstChild.textContent = 'Show details';
133
139
  });
134
140
  }
141
+
142
+ // Newly revealed diagrams must be rendered when switching views.
143
+ if (typeof window.renderMermaidIn === 'function') {
144
+ window.renderMermaidIn(document);
145
+ } else {
146
+ window.__mermaidRenderPending = true;
147
+ }
135
148
  });
136
149
 
137
150
  /* --- Expand / Collapse individual sections --- */
@@ -140,6 +153,7 @@
140
153
  var content = btn.nextElementSibling;
141
154
  var isExpanded = content.classList.toggle('expanded');
142
155
  btn.classList.toggle('expanded', isExpanded);
156
+ btn.setAttribute('aria-expanded', String(isExpanded));
143
157
  btn.firstChild.textContent = isExpanded ? 'Hide details' : 'Show details';
144
158
 
145
159
  // Mermaid diagrams inside collapsed detail blocks render at tiny sizes
@@ -375,6 +389,7 @@
375
389
 
376
390
  // Build nav links from rendered sections
377
391
  var ul = document.createElement('ul');
392
+ ul.className = 'wm-side-nav';
378
393
  sections.forEach(function (section) {
379
394
  var h2 = section.querySelector('h2');
380
395
  if (!h2) return;
@@ -992,34 +1007,79 @@
992
1007
  }
993
1008
  })();
994
1009
  </script>
995
- <script type="module">
996
- import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
997
- mermaid.initialize({
998
- startOnLoad: false,
999
- theme: document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default',
1000
- flowchart: { useMaxWidth: true, htmlLabels: true },
1001
- sequence: { useMaxWidth: true }
1002
- });
1003
-
1004
- window.renderMermaidIn = async function (root) {
1005
- var scope = root || document;
1006
- var nodes = Array.from(scope.querySelectorAll('.mermaid')).filter(function (el) {
1007
- return el.offsetParent !== null && !el.dataset.mermaidRendered;
1008
- });
1009
-
1010
- if (!nodes.length) return;
1011
-
1012
- try {
1013
- await mermaid.run({ nodes: nodes });
1014
- nodes.forEach(function (el) {
1015
- el.dataset.mermaidRendered = 'true';
1016
- });
1017
- } catch (err) {
1018
- console.error('Mermaid render error:', err);
1019
- }
1020
- };
1021
-
1022
- window.renderMermaidIn(document);
1010
+ <script type="module">
1011
+ import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
1012
+
1013
+ function mermaidTheme() {
1014
+ return document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default';
1015
+ }
1016
+
1017
+ let currentMermaidTheme = null;
1018
+
1019
+ function initMermaid(theme) {
1020
+ currentMermaidTheme = theme;
1021
+ mermaid.initialize({
1022
+ startOnLoad: false,
1023
+ theme: theme,
1024
+ flowchart: { useMaxWidth: true, htmlLabels: true },
1025
+ sequence: { useMaxWidth: true }
1026
+ });
1027
+ }
1028
+
1029
+ initMermaid(mermaidTheme());
1030
+
1031
+ // Keep the original diagram source so nodes can be re-rendered (e.g. on theme change).
1032
+ const mermaidSources = new WeakMap();
1033
+ let mermaidSeq = 0;
1034
+
1035
+ async function renderNode(el) {
1036
+ let source = mermaidSources.get(el);
1037
+ if (source === undefined) {
1038
+ source = el.textContent;
1039
+ mermaidSources.set(el, source);
1040
+ }
1041
+ try {
1042
+ // mermaid.render() draws in a detached container, so nodes inside
1043
+ // collapsed/hidden blocks still render at the correct size.
1044
+ const { svg, bindFunctions } = await mermaid.render('mermaid-svg-' + ++mermaidSeq, source);
1045
+ el.innerHTML = svg;
1046
+ if (bindFunctions) bindFunctions(el);
1047
+ el.removeAttribute('data-processed');
1048
+ el.dataset.mermaidRendered = 'true';
1049
+ } catch (err) {
1050
+ console.error('Mermaid render error:', err);
1051
+ el.textContent = source;
1052
+ delete el.dataset.mermaidRendered;
1053
+ }
1054
+ }
1055
+
1056
+ window.renderMermaidIn = async function (root, force) {
1057
+ const scope = root && root.querySelectorAll ? root : document;
1058
+ const nodes = Array.from(scope.querySelectorAll('.mermaid')).filter(function (el) {
1059
+ return force || !el.dataset.mermaidRendered;
1060
+ });
1061
+ // Render one at a time so a single bad diagram cannot abort the rest.
1062
+ for (const el of nodes) await renderNode(el);
1063
+ };
1064
+
1065
+ window.refreshMermaidTheme = async function () {
1066
+ const next = mermaidTheme();
1067
+ if (next === currentMermaidTheme) return;
1068
+ initMermaid(next);
1069
+ await window.renderMermaidIn(document, true);
1070
+ };
1071
+
1072
+ await window.renderMermaidIn(document);
1073
+
1074
+ // A toggle clicked before this module finished loading sets a pending flag.
1075
+ if (window.__mermaidRenderPending) {
1076
+ window.__mermaidRenderPending = false;
1077
+ window.renderMermaidIn(document);
1078
+ }
1079
+ if (window.__mermaidThemePending) {
1080
+ window.__mermaidThemePending = false;
1081
+ window.refreshMermaidTheme();
1082
+ }
1023
1083
  </script>
1024
1084
  </body>
1025
1085
  </html>
package/style.css CHANGED
@@ -16,10 +16,6 @@
16
16
  /* CV-specific tokens */
17
17
  --color-project-ref-underline: #b0b0b0;
18
18
  --color-tag-bg: var(--wm-color-surface-muted, #f7f7f7);
19
- --color-tag-border: #ececec;
20
- --color-role-project-bg: var(--wm-color-accent-soft, #f0f4ff);
21
- --color-role-project-border: var(--wm-color-accent-border, #d8e0f0);
22
- --color-role-project-text: var(--wm-color-accent, #2a4a8a);
23
19
  --color-toggle-bg: #f0f0f0;
24
20
  --color-toggle-hover: #e0e0e0;
25
21
  --tile-bg: var(--wm-color-surface-strong, #efefef);
@@ -47,10 +43,6 @@
47
43
  /* CV-specific tokens */
48
44
  --color-project-ref-underline: #555;
49
45
  --color-tag-bg: #1e1e1e;
50
- --color-tag-border: #333;
51
- --color-role-project-bg: var(--wm-color-accent-soft, #1a2240);
52
- --color-role-project-border: var(--wm-color-accent-border, #2a3560);
53
- --color-role-project-text: var(--wm-color-accent, #7aa0e8);
54
46
  --color-toggle-bg: #2a2a2a;
55
47
  --color-toggle-hover: var(--wm-color-border-strong, #3a3a3a);
56
48
  --tile-bg: var(--wm-color-surface-solid, #1c1c1c);
@@ -146,8 +138,8 @@ html {
146
138
  }
147
139
 
148
140
  body {
149
- font-family: "Inter", "Söhne", system-ui, -apple-system, "Segoe UI",
150
- Helvetica, Arial, sans-serif;
141
+ font-family: var(--wm-font-sans, "Inter", "Söhne", system-ui, -apple-system,
142
+ "Segoe UI", Helvetica, Arial, sans-serif);
151
143
  color: var(--color-text);
152
144
  background: var(--color-bg);
153
145
  line-height: 1.6;
@@ -473,17 +465,6 @@ ul.keywords {
473
465
  margin: 0.4rem 0 0;
474
466
  }
475
467
 
476
- ul.keywords li {
477
- font-size: 0.75rem;
478
- padding: 0.2rem 0.6rem;
479
- background: var(--color-tag-bg);
480
- border: 1px solid var(--color-tag-border);
481
- border-radius: 100px;
482
- color: var(--color-text-secondary);
483
- white-space: nowrap;
484
- font-weight: 400;
485
- }
486
-
487
468
  /* --- Role Project Listing --- */
488
469
  .role-projects {
489
470
  margin: 0.6rem 0 0.25rem;
@@ -511,18 +492,9 @@ ul.role-projects-list {
511
492
  margin: 0;
512
493
  }
513
494
 
514
- ul.role-projects-list li {
515
- font-size: 0.75rem;
516
- padding: 0.2rem 0.6rem;
517
- background: var(--color-role-project-bg);
518
- border: 1px solid var(--color-role-project-border);
519
- border-radius: 100px;
520
- white-space: nowrap;
521
- }
522
-
523
495
  ul.role-projects-list li a.project-ref {
524
496
  text-decoration: none;
525
- color: var(--color-role-project-text);
497
+ color: inherit;
526
498
  }
527
499
 
528
500
  ul.role-projects-list li a.project-ref:hover {
@@ -677,10 +649,6 @@ ul.role-projects-list li a.project-ref:hover {
677
649
  margin: 0;
678
650
  }
679
651
 
680
- .side-nav li {
681
- margin-bottom: 0.1rem;
682
- }
683
-
684
652
  .side-nav-group {
685
653
  margin-bottom: 0.18rem;
686
654
  }
@@ -747,18 +715,11 @@ ul.role-projects-list li a.project-ref:hover {
747
715
  }
748
716
 
749
717
  .side-nav a {
750
- display: block;
751
718
  padding: 0.5rem 0.6rem;
752
719
  font-size: var(--section-label-font-size);
753
720
  font-weight: var(--section-label-font-weight);
754
721
  line-height: var(--section-label-line-height);
755
- text-transform: uppercase;
756
722
  letter-spacing: var(--section-label-letter-spacing);
757
- color: var(--color-text-muted);
758
- text-decoration: none;
759
- border-left: 2px solid transparent;
760
- border-radius: 0 3px 3px 0;
761
- transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
762
723
  }
763
724
 
764
725
  .side-nav > ul > .side-nav-group > a {
@@ -766,17 +727,6 @@ ul.role-projects-list li a.project-ref:hover {
766
727
  top: -2px;
767
728
  }
768
729
 
769
- .side-nav a:hover {
770
- color: var(--color-text);
771
- background: var(--color-tag-bg);
772
- }
773
-
774
- .side-nav a.active {
775
- color: var(--color-text);
776
- border-left-color: var(--color-text);
777
- background: var(--color-tag-bg);
778
- }
779
-
780
730
  .side-nav a.side-nav-sublink {
781
731
  padding: 0.2rem 0.6rem;
782
732
  font-size: 0.66rem;
@@ -852,21 +802,6 @@ ul.role-projects-list li a.project-ref:hover {
852
802
  }
853
803
 
854
804
  /* --- Theme Toggle --- */
855
- .theme-toggle {
856
- background: var(--color-toggle-bg);
857
- border: 1px solid var(--color-border);
858
- border-radius: 100px;
859
- padding: 0.3rem 0.7rem;
860
- cursor: pointer;
861
- font-size: 0.7rem;
862
- line-height: 1;
863
- transition: background 0.2s ease, border-color 0.2s ease;
864
- }
865
-
866
- .theme-toggle:hover {
867
- background: var(--color-toggle-hover);
868
- }
869
-
870
805
  .theme-toggle .icon-sun,
871
806
  .theme-toggle .icon-moon {
872
807
  display: none;
@@ -899,28 +834,8 @@ ul.role-projects-list li a.project-ref:hover {
899
834
  position: static;
900
835
  }
901
836
 
902
- .print-btn,
903
- .view-toggle,
904
- .nav-pos-toggle,
905
- .layout-mode-toggle {
906
- background: var(--color-toggle-bg);
907
- border: 1px solid var(--color-border);
908
- border-radius: 100px;
909
- padding: 0.3rem 0.7rem;
910
- cursor: pointer;
911
- font-family: inherit;
912
- font-size: 0.7rem;
913
- font-weight: 500;
914
- text-transform: uppercase;
915
- letter-spacing: 0.06em;
916
- color: var(--color-text-muted);
917
- line-height: 1;
918
- transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
919
- }
920
-
921
837
  .control-icon {
922
838
  display: inline-block;
923
- margin-right: 0.35rem;
924
839
  font-size: 0.85em;
925
840
  line-height: 1;
926
841
  }
@@ -929,14 +844,6 @@ ul.role-projects-list li a.project-ref:hover {
929
844
  display: inline-block;
930
845
  }
931
846
 
932
- .print-btn:hover,
933
- .view-toggle:hover,
934
- .nav-pos-toggle:hover,
935
- .layout-mode-toggle:hover {
936
- background: var(--color-toggle-hover);
937
- color: var(--color-text);
938
- }
939
-
940
847
  /* --- Expandable Content (Summary View) --- */
941
848
  .detail-content {
942
849
  /* In detailed view: always visible */
@@ -944,18 +851,9 @@ ul.role-projects-list li a.project-ref:hover {
944
851
 
945
852
  .expand-toggle {
946
853
  display: none; /* Hidden in detailed view */
947
- background: none;
948
- border: none;
949
- cursor: pointer;
950
- font-size: 0.75rem;
951
- color: var(--color-text-muted);
952
- padding: 0.15rem 0;
953
- font-family: inherit;
954
- transition: color 0.15s ease;
955
- }
956
-
957
- .expand-toggle:hover {
958
- color: var(--color-text);
854
+ flex-wrap: wrap;
855
+ justify-content: flex-start;
856
+ text-align: left;
959
857
  }
960
858
 
961
859
  .toggle-meta {
@@ -963,17 +861,6 @@ ul.role-projects-list li a.project-ref:hover {
963
861
  font-weight: 400;
964
862
  }
965
863
 
966
- .expand-toggle::before {
967
- content: "▸ ";
968
- display: inline-block;
969
- font-size: 1.1em;
970
- transition: transform 0.15s ease;
971
- }
972
-
973
- .expand-toggle.expanded::before {
974
- content: "▾ ";
975
- }
976
-
977
864
  /* Summary view: hide detail content, show expand toggles */
978
865
  [data-view="summary"] .detail-content {
979
866
  display: none;
@@ -984,7 +871,7 @@ ul.role-projects-list li a.project-ref:hover {
984
871
  }
985
872
 
986
873
  [data-view="summary"] .expand-toggle {
987
- display: inline-block;
874
+ display: inline-flex;
988
875
  }
989
876
 
990
877
  [data-view="summary"] .project-gallery {
@@ -1154,7 +1041,7 @@ ul.role-projects-list li a.project-ref:hover {
1154
1041
  .lightbox-img {
1155
1042
  max-width: 90vw;
1156
1043
  max-height: 80vh;
1157
- border-radius: 8px;
1044
+ border-radius: var(--wm-radius-base, 8px);
1158
1045
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
1159
1046
  object-fit: contain;
1160
1047
  }
@@ -1162,7 +1049,7 @@ ul.role-projects-list li a.project-ref:hover {
1162
1049
  .lightbox-svg {
1163
1050
  max-width: 90vw;
1164
1051
  max-height: 80vh;
1165
- border-radius: 8px;
1052
+ border-radius: var(--wm-radius-base, 8px);
1166
1053
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
1167
1054
  background: var(--color-tag-bg, #f8f8f8);
1168
1055
  border: 1px solid var(--color-border, #e0e0e0);