Repository navigation
MSPCA-32 Add Chakra UI v3 and theme.ts - #15
Merged
Merged
Conversation
- Install @chakra-ui/react v3 and @emotion/react. - Add apps/frontend/src/theme.ts with the Figma colors (exported as `colors` and registered as Chakra tokens), the semantic bg/fg/border/ text/neutral tokens, Montserrat fonts and weights, and h1-h7/body/ body-small text styles that switch to the Figma mobile sizes below md. - Give common tags (body, h1-h6, p, li, label, small, a, form controls) their typography through globalCss. - Wrap the app in ChakraProvider and load Montserrat from Google Fonts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Juwang110
marked this pull request as ready for review
October 17, 2026 15:35
- Each text style now sets its own fontWeight (semibold for headings, normal for body), so <Text textStyle="h3"> matches a raw <h3>. - Drop the globalCss heading/body fontWeight rules this replaces. - Wrap text styles in defineTextStyles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Authenticator was never given its stylesheet, so it relied on browser defaults; Chakra's CSS reset removed those, leaving borderless inputs and buttons that looked like plain text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dburkhart07
approved these changes
Oct 18, 2026
dburkhart07
left a comment
Collaborator
There was a problem hiding this comment.
looks very good aside from a few small things. tysm for this justin!!!
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
ℹ️ Issue
Closes MSPCA-32
📝 Description
Adds Chakra UI v3 and a
theme.tswith the brand colors and typography from the MSPCA UI Kit in Figma, so frontend pages can use named tokens likecolor="blue.primary"ortextStyle="h3"instead of hardcoded hex codes and font sizes. Changing a value intheme.tschanges it across the whole app.Changes:
@chakra-ui/react(v3.37) and@emotion/react.apps/frontend/src/theme.ts, built from the Figma file's variables and text styles:colorsholds every brand color's hex code (black, gray 0–900, error, blue, orange, green, teal, brown, neutrals, and the Trello foster-restriction label colors). It's exported for places where Chakra props aren't available, and the same values are registered as Chakra tokens (blue.primary,trello.dogFreeHome, ...).blackis pure#000000, which Figma uses directly infg,text.fg, andbg.inverted. It replaces Chakra's defaultblack(#09090B). It's not the same as the brand blackneutrals.black(#231f20).bg,fg,border,text,neutral) use the Figma values in place of Chakra's defaults.thin–black, and text stylesh1–h7,body,body-small,xs, and2xs(defined withdefineTextStyles). Figma only has font sizes forxs(12/10px) and2xs(10/8px), with no text style or line height, so those two use Chakra's default line heights (1rem and 0.75rem). Each text style includes its weight (semibold for headings, normal for body), so<Text textStyle="h3">looks the same as a plain<h3>, and afontWeightprop can still override it. Figma defines Desktop and Mobile sizes, so each text style uses the mobile size below Chakra'smdbreakpoint (768px) and the desktop size above it.globalCss:body,h1–h6,p,li,label,small,figcaption,a, and form controls.<ChakraProvider value={system}>inmain.tsx, outside the auth branch so both paths get the theme.index.htmlas a variable font (wght@100..900), so every weight token works from a single font file.@aws-amplify/ui-react/styles.cssinmain.tsx. The Amplify sign-in form never had its stylesheet and relied on browser defaults, which Chakra's CSS reset removes (inputs lost their borders and buttons looked like plain text). With the stylesheet, it renders Amplify's styled sign-in card. This adds ~30 kB of gzipped CSS.Radii and spacing aren't overridden: the Figma values match Chakra's defaults.
✔️ Verification
npx nx run frontend:typecheck,npx nx lint frontend, andnpx nx build frontendpass.npx nx serve frontendand checked computed styles in the browser for each tag:<Text textStyle="h3">and<Heading textStyle="h2">match the plain tags (36px/600 and 48px/600), andfontWeight="bold"overrides to 700.COGNITO_*set, the Amplify sign-in form renders as a styled card (bordered inputs, filled button) in Montserrat at desktop and mobile widths.--chakra-colors-blue-primary=#009cde;--chakra-colors-fg,-text-fg, and-bg-inverted=#000000viacolors.black), and there are no console errors.textStyle="xs"/"2xs"produce 10px / 8px on mobile and 12px / 10px frommdup.nx test frontendwas already failing onmain(parseCLI is not a function: the@nx/vite:testexecutor doesn't support vitest 0.32). Runningnpx vitest rundirectly inapps/frontendgives the same result before and after this change: the stale "Welcome frontend" assertion fails andapiClientlogs network errors.To try a token, render something like
<Heading as="h2" textStyle="h2" color="blue.primary">Hello</Heading>or<Text textStyle="body-small" color="fg.muted">...</Text>inroot.tsx. IfCOGNITO_USER_POOL_IDandCOGNITO_CLIENT_IDare set in.env, the sign-in form shows first, so comment them out (and restart the dev server) to see the page directly.🏕️ (Optional) Future Work / Notes