Repository navigation
Open
Labels
feature: Design systemRelated to design patterns and componentsmilestone: missingrole: Front Endsize: 2ptCan be done in 7-12 hours
Description
Trillium Firstmate 🤖
Overview
Move today's colors, fonts, type sizes, and breakpoints out of the MUI theme and into a Tailwind @theme block, and turn on the temporary important flag so Tailwind classes win over MUI and the old global SCSS while both exist. No visible change.
Dependencies
- Tailwind upgrade to the latest stable release: Update package: tailwindcss #2253
- Foundation: add the shared UI toolkit (cn helper, cva, '@/' alias, test setup, components/ui folder) #2257
Action Items
- In
client/src/tailwind.csschange the import to@import 'tailwindcss' important;and add a comment above it saying this is temporary and which ticket removes it. - Add a
@theme { ... }block in the same file with semantic tokens whose values are exactly today's values fromclient/src/theme/palette.jsandclient/src/theme/index.js:- colors:
--color-primary(#00008B),--color-secondary(#FA114F),--color-success(#008000),--color-error(#FF0000),--color-background(#FFFFFF),--color-surface(#F1F1F1, the MUI "paper" color),--color-foreground(#000000),--color-foreground-muted(#757575),--color-border-muted(#AAAAAA),--color-foreground-strong(#333333). Rename if a better name fits, but keep the values. - fonts:
--font-sans(Source Sans Pro, Roboto, "Helvetica Neue", Arial, sans-serif),--font-mono(Source Code Pro),--font-display(thealiseoregularfont thatindex.scssalready loads). - breakpoints: MUI's are
sm600 px,md900 px,lg1200 px; Tailwind's defaults are different (640/768/1024). Set--breakpoint-sm: 600px,--breakpoint-md: 900px,--breakpoint-lg: 1200pxso responsive code converts one-to-one. - type scale used by the MUI theme today: button 18 px/600, input text 14 px/500, label 16 px/600, h1 30 px bold mono, h3 16 px/600. Add them as
--text-*tokens.
- colors:
- Delete
client/tailwind.config.js(a Tailwind v3 file that v4 ignores) and confirm nothing references it. - Keep
postcss.config.js(autoprefixer still runs for the SCSS), but note in the PR that Tailwind itself runs through@tailwindcss/vite. - Add a Vitest test (
client/src/styles/tailwind-theme.test.ts) that readstailwind.cssand checks the token names above exist, so a later rename is noticed. - Prove the flag works: temporarily put
className="bg-red-600"on an MUIButtonand on a plain<button>, confirm both turn red, then remove the test classes. Record the result in the PR. - Do not touch
theme/palette.jsortheme/index.jsyet. MUI still reads them until the final MUI removal ticket.
Acceptance Criteria
- The
importantflag is on, with a comment pointing to the cleanup ticket. - All tokens above exist with the exact same values as the MUI theme.
-
tailwind.config.jsis gone and the build output is otherwise unchanged (CSS size change reported in the PR). - A before/after screenshot of the home page and the check-in form shows no visible change.
-
yarn typecheck,yarn buildandyarn testpass.
Resources/Instructions
- Tailwind v4 theme variables: https://tailwindcss.com/docs/theme
- The
importantoption: https://tailwindcss.com/docs/functions-and-directives (search "important") - Source of today's values:
client/src/theme/palette.js,client/src/theme/index.js,client/src/index.scss. - Why the flag is needed: the old global SCSS and MUI's emotion styles are not in a CSS layer, so they would otherwise beat Tailwind classes even when the Tailwind rule is more specific.
Additional Notes
- The temporary Tailwind
importantflag is on while MUI is still in the app (decided). That is what lets a Tailwind class beat MUI/emotion and the old global SCSS. It is removed in Final cleanup: remove the Tailwind 'important' flag and the old global SCSS #2288. - Decision needed: dark mode. The app is light-only today. Proposed default: out of scope for this epic. Name tokens by purpose (
surface,foreground) so a dark palette can be added later by redefining the same names in a.darkblock, without changing any component. - Decision needed: token naming. The list above is a proposal. The values are the rule.
responsiveFontSizes(theme)intheme/index.jsmakes MUI heading sizes scale with screen width. The typography ticket (UI kit: Heading, Text, and Link #2269) is where that behavior is matched.
Metadata
Metadata
Assignees
Labels
feature: Design systemRelated to design patterns and componentsmilestone: missingrole: Front Endsize: 2ptCan be done in 7-12 hours
Type
Projects
- StatusShow more project fieldsNew Issue Approval
Activity