PolicyEngine / PolicyEngine/policyengine-app-v2
Adopt vanilla-extract for styling
Open
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1
- Forks
- 3
- Avg merge
- 1d 50m
- Merged PRs (30d)
- 39
Description
Summary
Adopt vanilla-extract (VE) as the styling approach for policyengine-app-v2, replacing inline styles and style props with type-safe, zero-runtime CSS-in-JS.
Motivation
- Type safety: Styles are TypeScript — typos and invalid values caught at build time
- Zero runtime: Styles compile to static CSS, no runtime overhead from inline style objects
- Clean JSX: Component files contain logic and markup only; styles live in co-located
.css.tsfiles - Scalability: As the app grows,
.css.tsfiles are easier to maintain than scattered style props - Theme contracts:
createThemeContractprovides type-safe access to design tokens via CSS variables
Approach
- Install
@vanilla-extract/cssand@vanilla-extract/vite-plugin - Optionally use
@mantine/vanilla-extractfor Mantine component integration - Migrate incrementally — new components use VE, existing components migrated over time
- Design tokens from
@policyengine/design-systembecome a VE theme contract
What stays the same
- Mantine components (Card, Table, Grid, etc.) — still used for layout/UI
@policyengine/design-system— still the source of truth for tokens- Plotly charts — still configured via JS layout objects (VE doesn't apply here)
References
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no files, tests, or entry points. Start by reviewing the existing styling setup and the vanilla-extract and Mantine integration references, then define the token theme contract and migration boundary. Done means the dependencies are integrated, new styling uses co-located .css.ts files, and the incremental migration plan is established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vite
- Domain
- design, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100