Repository navigation
[Design] add the ThinkRail design-system library — live foundations - #951
Open
Julia Shilova (juliashilovaa) wants to merge 7 commits into
Open
Julia Shilova (juliashilovaa) wants to merge 7 commits into
Julia Shilova (juliashilovaa) wants to merge 7 commits into
Conversation
Julia Shilova (juliashilovaa)
requested review from
Olga Lavrichenko (OLavrik),
Rustam Sadykov (SBOne-Kenobi),
danyaberezun and
Rinat S (rsolmano)
as code owners
October 27, 2026 12:01
danyaberezun
force-pushed
the
button-system
branch
from
October 27, 2026 12:59
ff5f664 to
53da320
Compare
Julia Shilova (juliashilovaa)
force-pushed
the
ui-usage-rules
branch
from
October 27, 2026 13:26
429d234 to
d1df62b
Compare
🌐 Website preview
This comment updates in place on every push that touches the website or shared build inputs. |
danyaberezun
force-pushed
the
button-system
branch
from
October 27, 2026 16:58
aecfe58 to
ac576a0
Compare
added 3 commits
October 29, 2026 14:54
…ources index.css scans apps/web/src plus the TS/TSX of packages/ui, the renderers and extension web halves, so Markdown specs, generated references and the component library never add classes to the app's CSS. The app CSS only loses classes parsed from Markdown prose.
…tton apps/web/library is a second Vite entry that renders production components from source with the production stylesheet and every bundled theme: navigation, a Using the library guide, and complete Button and IconButton pages (variants, sizes, tone, live states, playground, copyable examples, anatomy, props, accessibility, rules, production usages). One typed content source feeds both the site and the generated packages/ui/COMPONENTS.md; library.test.ts keeps the reference, examples, usages and defaults in sync, and library:verify drives the site in Chromium. AGENTS.md and packages/ui/SPEC.md link to it.
A header with Guides / Components and the theme menu, a grouped sidebar, a Components overview with a name search and live, inert preview cards, and component pages with Import / Source / Docs rows, When to use, examples as a two-column grid of cards with show-code, and a sticky On this page outline. All in ThinkRail tokens, type classes and components.
Julia Shilova (juliashilovaa)
force-pushed
the
ui-usage-rules
branch
from
October 29, 2026 12:59
d1df62b to
bb1ef9e
Compare
Julia Shilova (juliashilovaa)
pushed a commit
that referenced
this pull request
Oct 29, 2026
…arrow pages sideways
Julia Shilova (juliashilovaa)
pushed a commit
that referenced
this pull request
Oct 29, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
There is no single maintained place where designers, developers, and AI agents can see ThinkRail's actual components, usage rules, working code, and the design system behind them.
Design guidance is scattered across multiple specs (COLOR, TYPOGRAPHY, SPACING, NOTIFICATIONS, UI-TERMINOLOGY, and module specs). Token values are repeated manually, component previews can drift from production, and the external designer prompt references outdated fonts and colors.
Goal
The long-term goal is to build an AI designer that can review new features against the existing design system, identify inconsistencies, and suggest improvements.
The first step is to establish a single, reliable source of design knowledge that stays synchronized with production and can be used by both humans and AI agents.
Solution
A design-system library inside the existing ThinkRail frontend, covering foundations, components, patterns, and vocabulary.
The library uses actual production components and tokens, maintains design rules in one place, and generates Markdown documentation from the same sources.
1. Architecture
apps/web/libraryis a second Vite entry ofapps/web, using the existing React, React Compiler, Tailwind, and@/alias setup.@thinkrail/ui/*, themes from@/themes.library.cssimports the application'sindex.css, so the library renders with the exact production styles and tokens.2. Single source of truth
Token values remain in their original sources:
colors.json,typography.json,spacing.jsontokens.cssand theme manifestsDesign rules, descriptions, and component documentation live in
apps/web/library/content/.Instead of repeating token values in documentation,
:::liveblocks render directly from production sources.15 live blocks cover color roles, alpha values, palettes across themes, typography, spacing, radius, icons, and themes.
The blocks reuse the existing token generators' logic (
typographyModel.ts,colorsModel.ts) rather than introducing separate calculations.3. Component documentation
Button and IconButton are the first fully documented components.
Each component page includes:
Component API documentation is type-checked against the actual TypeScript props, preventing documented variants, sizes, tones, and properties from drifting out of sync.
4. Library interface
The library is organized into five sections:
The interface includes a grouped sidebar, sticky page outline, live previews, collapsible code examples, and a theme switcher supporting all six production themes.
It uses ThinkRail's own typography, tokens, and components, with responsive navigation and a mobile drawer.
5. Generated documentation for AI agents
library/scripts/generate-md.tsgenerates documentation directly from library content:COLOR.mdTYPOGRAPHY.mdSPACING.mdNOTIFICATIONS.mdUI-TERMINOLOGY.mdpackages/ui/COMPONENTS.mdDESIGN.mdExisting specs retain their paths, frontmatter, and identifiers, so existing references continue working.
DESIGN.mdconsolidates the design prompt with current themes, fonts, typography, spacing, radius, and available components. It replaces the outdated external designer prompt.AGENTS.mdidentifies the library as the source of design rules, while existing specs link to the relevant library documentation instead of duplicating it.6. Validation
Added automated checks to keep the library synchronized with production:
library:verifyruns browser verification in Chromium, covering navigation, live blocks, search, themes, component states, accessibility behavior, code copying, and responsive layouts.Verification results:
main: no new classes, only unused Markdown-derived classes removed.7. Commands
Screenshots
Guides
Foundations
Components
Patterns
Vocabulary