Skip to content

Commit 54cfc83

Browse files
committed
feat: introduce ShellDocs.Tokens package for shared design tokens, enabling consistent theming across ShellDocs and ShellUI, and document token contract for consumer integration
1 parent edbb8cf commit 54cfc83

1 file changed

Lines changed: 35 additions & 10 deletions

File tree

docs/ROADMAP.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ See [DESIGN.md](DESIGN.md) for the high-level design and [ARCHITECTURE.md](ARCHI
2626
| `ShellDocs.Core` | Navigation graph, search index model, routing helpers |
2727
| `ShellDocs.Markdown` | Markdig pipeline + frontmatter + Razor component embedding |
2828
| `ShellDocs.Components` | RCL — UI primitives (DocsLayout, CodeBlock, SearchDialog, etc.) |
29+
| `ShellDocs.Tokens` | Shared CSS variable definitions — the palette + spacing scale that both ShellDocs and ShellUI-in-docs consume. Single source of truth for `--background`, `--foreground`, `--primary`, `--radius`, etc. |
2930
| `ShellDocs.CLI` | `shelldocs init`, `shelldocs new`, `shelldocs dev`, `shelldocs build` |
3031
| `ShellDocs.Templates` | Content for CLI scaffolding — starter markdown, meta.json, .csproj patches |
3132
| `ShellDocs.Xml` | v2 — extract `<TypeTable>` from XML doc comments |
@@ -38,17 +39,17 @@ Each branch below annotates which package it touches. Multi-package branches cal
3839

3940
Goal: a consumer can `shelldocs init` an empty Blazor WASM project and get a working docs site with sidebar, header, code blocks, and one theme.
4041

41-
### `chore/repo-scaffolding`
42+
### `chore/repo-scaffolding` — shipped
4243
Bootstrap the monorepo.
4344

44-
- `.sln` with the six package projects (`ShellDocs.Core`, `ShellDocs.Markdown`, `ShellDocs.Components`, `ShellDocs.CLI`, `ShellDocs.Templates`, plus `ShellDocs.Tests`)
45+
- `.slnx` (.NET 10 XML solution format) with all package projects + tests
4546
- `.csproj` files with correct `TargetFramework`, `IsPackable`, `PackageId`
4647
- `.gitignore`, `Directory.Build.props`, `Directory.Packages.props` for central package management
4748
- `.github/workflows/ci.yml` — build + test on every push
4849
- `.github/workflows/release.yml` — pack + push to NuGet on tag
4950
- Nothing shipped; groundwork only
5051

51-
### `feat/core-navigation-graph`
52+
### `feat/core-navigation-graph` — shipped
5253
Ships to `ShellDocs.Core`.
5354

5455
- `NavigationGraph` — tree of `NavigationNode { Url, Title, Description, Category, Order, Headings, Path }`
@@ -57,7 +58,7 @@ Ships to `ShellDocs.Core`.
5758
- Route resolution — `NavigationGraph.ResolveByUrl("/docs/button")` → node
5859
- Unit tests: markdown → tree, meta.json ordering, deep-nested folders
5960

60-
### `feat/markdown-pipeline`
61+
### `feat/markdown-pipeline` — shipped
6162
Ships to `ShellDocs.Markdown`.
6263

6364
- Markdig extension for YAML frontmatter (YamlDotNet)
@@ -67,15 +68,31 @@ Ships to `ShellDocs.Markdown`.
6768
- Type registry — `RegisterComponent<T>()` API for consumer to expose their components to inline tags
6869
- Unit tests: frontmatter parsing, fenced block replacement, tag resolution, unknown-tag graceful degradation
6970

70-
### `feat/components-shell`
71+
### `feat/components-shell` — shipped
7172
Ships to `ShellDocs.Components`.
7273

73-
- `DocsLayout` — full-page grid: header + sidebar + main + TOC placeholder + footer
74-
- `DocsHeader` — logo, primary nav, search-button placeholder, theme toggle, GitHub link
75-
- `DocsSidebar` — grouped nav from navigation graph, collapsible sections, active highlighting
74+
- `DocsLayout` — full-page grid: header + sidebar + main + TOC + footer, fumadocs-shaped
75+
- `DocsHeader` — logo, primary nav with hover mega-menu (icon cards), search-button placeholder, theme toggle, GitHub link, hamburger for mobile
76+
- `DocsSidebar` — grouped nav from navigation graph, collapsible sections (fumadocs pattern — closed by default, active-path auto-open), lucide-style icons per section/page, package selector (ShellDocs · Markdown · Core · CLI · Components), footer bar with GitHub + theme toggle
7677
- `MarkdownContent` — renders a doc page from a `.md` path via `MarkdownRenderer`
77-
- One theme preset baked in (`Shadcn`)
78-
- No search, no TOC, no code highlighting yet — those come in later branches
78+
- `TableOfContents` — right-rail nav (h2/h3), scroll-tracked via multi-active headings so the thumb slides smoothly, SVG-mask + coloured thumb pattern lifted from fumadocs' `ClerkTOCItems`
79+
- `PrevNextNav` — bordered cards, arrow icon square, translate-on-hover
80+
- `MobileNavState` service + fixed drawer + backdrop + auto-close on route change
81+
- Prism.js syntax highlighting (via CDN for now — Shiki lands in the next branch)
82+
- Neutral fumadocs-shaped palette (`--background`, `--foreground`, `--primary`, `--muted`, `--accent`, `--border`) — will move to `ShellDocs.Tokens` in the next branch
83+
84+
### `feat/design-tokens`**next**
85+
Ships to new package `ShellDocs.Tokens`.
86+
87+
Extracts the palette + scale from `ShellDocs.Components/wwwroot/shelldocs-theme.css` into its own package so ShellUI (and any third-party consumer) can depend on the *tokens* without pulling in the whole components RCL.
88+
89+
- New `ShellDocs.Tokens` project — RCL that ships a single `wwwroot/tokens.css` with `:root` + `:root.dark` variable definitions
90+
- `ShellDocs.Components` and `ShellDocs.Preview` update their `App.razor` link to `_content/ShellDocs.Tokens/tokens.css` and remove the inline theme file
91+
- Add a `tokens-full.css` variant for consumers who want the extended set (semantic + chart colors), and a `tokens-base.css` for consumers who only want the core palette
92+
- Document the token contract in `docs/TOKENS.md`: which names are stable, which are internal, and how to override
93+
- **ShellUI integration path (Tailwind install):** ShellUI's Tailwind config reads the same `--primary`, `--background`, `--border` etc. — nothing changes on their side. Consumer just references `tokens.css` and both design systems light up together.
94+
- **ShellUI integration path (NuGet install):** ShellUI's RCL detects `ShellDocs.Tokens` at runtime and skips emitting its own token file. Deferred to Phase 3 — needs a small opt-in flag on `AddShellUI()`.
95+
- Unit tests: token file emits, dark-mode class toggling, no duplicate declarations across bundles
7996

8097
### `feat/codeblock-shiki`
8198
Ships to `ShellDocs.Components`.
@@ -303,6 +320,14 @@ ShellDocs depends on `ShellUI.Components` for base primitives:
303320

304321
**Locked ShellUI version:** ShellDocs targets `ShellUI.Components >= 0.5.0` (the version that ships `feat/data-selection-suite` — CommandPalette is required). Bumps require a ShellDocs major/minor.
305322

323+
### Install path — Tailwind-first, NuGet later
324+
325+
Mirrors how shadcn interops with fumadocs: shared CSS variables on `:root`, both design systems read them, one visual language.
326+
327+
- **Phase 1–2 (now):** ShellUI ships as a Tailwind consumer. Doc site owners install ShellUI the same way they would in any Blazor app — via `shellui add card` etc. — and the components read the same `--primary`, `--muted`, `--border` tokens that ShellDocs emits. Zero interop work; a `<Card>` written mid-markdown just picks up the ShellDocs palette. `ShellDocs.Tokens` (next branch) formalizes the contract so both packages point at the same source of truth.
328+
- **Phase 3+ (`feat/shellui-nuget-interop`):** teach the ShellUI NuGet RCL to defer to `ShellDocs.Tokens` when it's on the classpath, so shipping both packages doesn't double-emit `:root` blocks. Small change — an `AddShellUI(o => o.UseSharedTokens())` opt-in. Deferred because it's not blocking for real docs sites — Tailwind consumers get 90% of the value today, and the NuGet story only matters for pure-server projects that don't run Tailwind.
329+
- **Not doing:** shipping a "ShellUI-NuGet-only" install story for now. It'd double the QA surface for zero customer wins on day one. Revisit when a real consumer asks.
330+
306331
---
307332

308333
## Effort estimates (rough)

0 commit comments

Comments
 (0)