Skip to content

Upgrade Classicy from 0.6.31 to 3.4.0 - #59

Open
robbiebyrd wants to merge 1 commit into
c-ehrlich:mainfrom
robbiebyrd:upgrade-classicy-v3
Open

robbiebyrd wants to merge 1 commit into
c-ehrlich:mainfrom
robbiebyrd:upgrade-classicy-v3

Conversation

@robbiebyrd

@robbiebyrd robbiebyrd commented Nov 17, 2026 •

Copy link
Copy Markdown

This PR...

Upgrades the classicy package to its latest. Because I made so many breaking changes, I thought it was my duty to post this PR here. Thanks for your consideration and for using my little UI package!

Summary

Upgrades the Classic Mac OS UI framework from classicy@0.6.31 to @classicy/classicy@3.4.0. In v3 the package was renamed and the Platinum look moved into @classicy/appearance-platinum. Only packages/classicyui imports Classicy directly, so most of the change stays in that wrapper.

Dropping 0.6.31 also removes ~300 transitive packages (e.g. @mdxeditor/editor, @tailwindcss/vite were runtime deps of the old package).

What changed and why

Dependency and runtime wiring (packages/classicyui)

  • Swapped the dependency for @classicy/classicy + @classicy/appearance-platinum, both ^3.4.0.
  • Importing @classicy/appearance-platinum registers Platinum and injects its stylesheet and fonts. The v3 core also injects its own base CSS, so the hand-rolled ../node_modules/classicy/dist/classicy.css?raw injection (and the *.css?raw type shim) is gone.
  • All Platinum rules are scoped under .classicyDesktop[data-classicy-appearance=platinum], which <ClassicyDesktop> normally renders. Micropolis doesn't use <ClassicyDesktop>, so ClassicyRuntimeProvider renders that scope itself.
    • It uses display: contents, so the core's desktop box rules (full size, overflow: hidden, wallpaper) don't touch layout.
    • Tooltip and popover portals mount into the scope through a new useClassicyPortalContainer() hook, so they keep the Platinum look.

Cascade layers (the important one)

  • v3 wraps its CSS in @layer classicy.* and prepends its <style> tags to <head>. Its layers are therefore declared first and rank lowest, which let Tailwind's preflight (button { border: 0; background: transparent; border-radius: 0 }) erase button borders, corner radii and the greyed-out disabled state.
  • The runtime now pins @layer theme, base, components, utilities, classicy; ahead of everything else. Putting Classicy last keeps the precedence the 0.x unlayered stylesheet had: Classicy beats non-important utilities, and ! utilities (!m-0, …) still override Classicy. That is the model the existing call sites are written against.
    • I also measured the other order (classicy just above base). It brought back many utilities that had never visibly applied (text-[11px], px-2 py-1, border-2, bg-*), so I rejected it.

v3 class renames

  • classicyButtonDefault → default (the default ring is now drawn by Platinum).
  • ClassicyCheckbox → classicyCheckbox classicyCheckboxX (the X variant keeps the classic × mark), and ClassicyCheckboxMixed → mixed.
  • classicyWindowActive was removed in v3 (inactive windows get *Dimmed classes instead), so the dialog no longer adds it.

Sizing

  • v3 moved button padding and margin off .classicyButton into classicyButtonPadding* and classicyButtonMargin* variants. ClassicyButton now applies the Md variants, as upstream's own button does; without them buttons were about 6px shorter.
  • v3 adds min-height, a 58px HIG min-width and a small-square height. Where the app sets an explicit size (h-9/min-h-9 tool palette, min-w-* on menu and toolbar buttons, the window close button, toggle segments), that utility is now !-prefixed so it still wins.

Vite

  • Both packages are excluded from optimizeDeps, per the Platinum README: their fonts, art and sounds load via new URL('assets/…', import.meta.url), which pre-bundling breaks.

Verification

  • pnpm typecheck: passes in all 12 packages.
  • pnpm lint: 0 errors. The 7 warnings are pre-existing ones in apps/scenario-editor.
  • pnpm build (web and scenario editor): succeeds.
  • pnpm test: all suites pass under Node 24.
    • Running the whole monorepo in parallel, @city/web intermittently fails to start forks workers (ERR_REQUIRE_ESM) for 2 files. This reproduces identically on main, and apps/web passes 3/3 when run on its own.
  • Visual parity against main:
    • I ran both builds side by side and recorded the box and computed style of every button, Classicy element, section and header across 9 screens (home, menu, New City, in-game, Budget, Evaluation and Graph windows, Disasters, Settings), about 450 elements in total.
    • 0 differences in border, background, corner radius or font weight.
    • The remaining size differences are intended v3 Platinum metrics: push buttons are about 4px wider (HIG 8px text padding), buttons with no explicit width get the HIG 58px minimum, the mute square is 6px shorter (v3 squares have no padding), and the notice text is slightly more compact (Platinum ships the classic Monaco font).
    • The scenario editor's top screen is pixel-identical to main.
  • Other visible changes: range sliders now take the Platinum theme accent colour, and the old forwardRef console warning from Classicy 0.6 is gone.

Notes

  • The README asks for Node ≥ 24. Vite 7's dev server doesn't start on Node 20.11.

🤖 Generated with Claude Code

Classicy 3 is published as `@classicy/classicy` with its Platinum look split
into `@classicy/appearance-platinum`. This swaps the dependency and adapts
the `@city/classicyui` wrapper to the v3 styling model:

- Import the Platinum package (registers it and injects its CSS/fonts) and
  drop the hand-rolled `classicy.css?raw` injection; the core self-injects.
- Render the `.classicyDesktop[data-classicy-appearance=platinum]` scope that
  all Platinum rules require, as a `display: contents` element so the core's
  desktop box rules do not affect layout. Tooltip and popover portals mount
  into that scope via a new `useClassicyPortalContainer` context.
- Classicy 3 ships its CSS in `@layer classicy.*` and prepends it to <head>,
  so Tailwind's preflight was erasing button borders, radii and disabled
  faces. Pin the layer order with Classicy last, which preserves the
  precedence of the old unlayered 0.x stylesheet (`!` utilities still win).
- Follow v3 class renames: `classicyButtonDefault` -> `default`,
  `ClassicyCheckbox` -> `classicyCheckbox classicyCheckboxX`,
  `ClassicyCheckboxMixed` -> `mixed`; drop `classicyWindowActive`.
- Apply v3's default `md` padding/margin variant classes in ClassicyButton,
  as upstream's own button does (v3 moved padding off `.classicyButton`).
- Mark explicit app min/height sizes on buttons `!important` where v3's new
  min-width/min-height rules would otherwise override them.
- Exclude both packages from Vite dep pre-bundling (asset URLs rely on
  `import.meta.url`), per the Platinum README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 17, 2026

Copy link
Copy Markdown

@robbiebyrd is attempting to deploy a commit to the cehrlich's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant