PolicyEngine / PolicyEngine/policyengine-app-v2

Adopt vanilla-extract for styling

Open
#662 2 comments 0 reactions 0 assignees View on GitHub

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.ts files
  • Scalability: As the app grows, .css.ts files are easier to maintain than scattered style props
  • Theme contracts: createThemeContract provides type-safe access to design tokens via CSS variables

Approach

  1. Install @vanilla-extract/css and @vanilla-extract/vite-plugin
  2. Optionally use @mantine/vanilla-extract for Mantine component integration
  3. Migrate incrementally — new components use VE, existing components migrated over time
  4. Design tokens from @policyengine/design-system become 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.