diff --git a/apps/scenario-editor/src/routes/-editor-ui.tsx b/apps/scenario-editor/src/routes/-editor-ui.tsx
index f9f84a77..d3731af7 100644
--- a/apps/scenario-editor/src/routes/-editor-ui.tsx
+++ b/apps/scenario-editor/src/routes/-editor-ui.tsx
@@ -150,7 +150,5 @@ export function EditorSecondaryButton({ className, ...props }: ComponentPropsWit
* Not from Micropolis C: editor-only export action styling.
*/
export function EditorPrimaryButton({ className, ...props }: ComponentPropsWithoutRef<'button'>) {
- return (
-
- );
+ return ;
}
diff --git a/apps/scenario-editor/src/routes/-section-map.tsx b/apps/scenario-editor/src/routes/-section-map.tsx
index 6f7eda27..ce5162ef 100644
--- a/apps/scenario-editor/src/routes/-section-map.tsx
+++ b/apps/scenario-editor/src/routes/-section-map.tsx
@@ -985,7 +985,7 @@ export function ScenarioMapFinalWorkbench(options: {
activeBrushFamily === 'zones' && option.key === activeZoneOptionKey
}
activeClassName={CLASSICY_MAP_SIDEBAR_BUTTON_ACTIVE_CLASS}
- className={`${CLASSICY_MAP_SIDEBAR_BUTTON_CLASS} flex min-h-[3.4rem] items-center justify-center rounded-lg`}
+ className={`${CLASSICY_MAP_SIDEBAR_BUTTON_CLASS} flex !min-h-[3.4rem] items-center justify-center rounded-lg`}
key={option.key}
onClick={() => {
closeToolVariantContextMenu();
diff --git a/apps/scenario-editor/src/routes/__root.tsx b/apps/scenario-editor/src/routes/__root.tsx
index e1713ede..cdd1eb44 100644
--- a/apps/scenario-editor/src/routes/__root.tsx
+++ b/apps/scenario-editor/src/routes/__root.tsx
@@ -99,7 +99,7 @@ function EditorTopBar() {
{
setFileMenuOpen((current) => !current);
}}
@@ -121,7 +121,7 @@ function EditorTopBar() {
{
if (selected) {
diff --git a/apps/scenario-editor/vite.config.ts b/apps/scenario-editor/vite.config.ts
index 3b3f2c16..71e6d478 100644
--- a/apps/scenario-editor/vite.config.ts
+++ b/apps/scenario-editor/vite.config.ts
@@ -15,6 +15,11 @@ export default defineConfig({
tailwindcss(),
react(),
],
+ optimizeDeps: {
+ // Classicy loads its fonts, art and sounds via `new URL('assets/…', import.meta.url)`;
+ // pre-bundling relocates the modules and breaks those URLs.
+ exclude: ['@classicy/classicy', '@classicy/appearance-platinum'],
+ },
test: {
environment: 'node',
},
diff --git a/apps/web/src/features/playable-runtime/presentation/runtime-panel/sections/sidebar.tsx b/apps/web/src/features/playable-runtime/presentation/runtime-panel/sections/sidebar.tsx
index 81bf6ab3..143000a3 100644
--- a/apps/web/src/features/playable-runtime/presentation/runtime-panel/sections/sidebar.tsx
+++ b/apps/web/src/features/playable-runtime/presentation/runtime-panel/sections/sidebar.tsx
@@ -71,7 +71,7 @@ export function RuntimeSidebarSection(props: RuntimeSidebarSectionProps) {
}}
title={`${spec.label} ($${spec.baseCost})`}
type="button"
- className={`!m-0 flex h-9 min-h-9 max-h-9 w-9 min-w-9 max-w-9 items-center justify-center border-2 p-0 ${
+ className={`!m-0 flex !h-9 !min-h-9 max-h-9 w-9 min-w-9 max-w-9 items-center justify-center border-2 p-0 ${
active
? '!border-[var(--color-theme-07)] !bg-[var(--color-theme-03)]'
: '!border-[var(--color-black)] !bg-[var(--color-system-02)]'
diff --git a/apps/web/src/features/playable-runtime/presentation/runtime-panel/sections/top-bar.tsx b/apps/web/src/features/playable-runtime/presentation/runtime-panel/sections/top-bar.tsx
index f4c8be0d..b7003c86 100644
--- a/apps/web/src/features/playable-runtime/presentation/runtime-panel/sections/top-bar.tsx
+++ b/apps/web/src/features/playable-runtime/presentation/runtime-panel/sections/top-bar.tsx
@@ -51,7 +51,7 @@ export function RuntimeTopBarSection(props: RuntimeTopBarSectionProps) {
} = props;
const activeToolSpec = getPlayableToolSpec(ui.activeTool);
const menubarButtonClass =
- '!m-0 min-w-[calc(var(--window-control-size)*7)] px-2 py-1 text-center';
+ '!m-0 !min-w-[calc(var(--window-control-size)*7)] px-2 py-1 text-center';
const menubarPanelClass = 'absolute left-0 top-[calc(100%+3px)] z-[12] grid p-1.5';
return (
@@ -114,7 +114,7 @@ export function RuntimeTopBarSection(props: RuntimeTopBarSectionProps) {
onClick={() => {
simulationActions.playPauseSimulation();
}}
- className="!m-0 min-w-21 font-bold"
+ className="!m-0 !min-w-21 font-bold"
type="button"
>
{session.isSimulationRunning ? 'Pause' : 'Play'}
diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts
index 50ece70b..26bbb9ea 100644
--- a/apps/web/vite.config.ts
+++ b/apps/web/vite.config.ts
@@ -14,6 +14,11 @@ export default defineConfig({
tailwindcss(),
react(),
],
+ optimizeDeps: {
+ // Classicy loads its fonts, art and sounds via `new URL('assets/…', import.meta.url)`;
+ // pre-bundling relocates the modules and breaks those URLs.
+ exclude: ['@classicy/classicy', '@classicy/appearance-platinum'],
+ },
test: {
environment: 'node',
},
diff --git a/packages/classicyui/package.json b/packages/classicyui/package.json
index 7c4df08a..6e939c53 100644
--- a/packages/classicyui/package.json
+++ b/packages/classicyui/package.json
@@ -11,8 +11,9 @@
},
"types": "./src/index.ts",
"dependencies": {
+ "@classicy/appearance-platinum": "^3.4.0",
+ "@classicy/classicy": "^3.4.0",
"@radix-ui/react-tooltip": "^1.2.8",
- "classicy": "^0.6.31",
"clsx": "2.1.1"
},
"devDependencies": {
diff --git a/packages/classicyui/src/classicy-button.tsx b/packages/classicyui/src/classicy-button.tsx
index eda7e41d..aad637d1 100644
--- a/packages/classicyui/src/classicy-button.tsx
+++ b/packages/classicyui/src/classicy-button.tsx
@@ -21,7 +21,9 @@ export interface ClassicyButtonProps extends Omit<
* Mirrors the clickable command widgets from `ref/micropolis/res/micropolis.tcl`
* and `ref/micropolis/res/whead.tcl`.
* Parity note: this is not a 1:1 port of Tcl widget internals; it composes
- * Classicy CSS contract classes into a typed React primitive.
+ * Classicy CSS contract classes into a typed React primitive, applying the same
+ * default (`md`) padding and margin variant classes as Classicy 3's own
+ * `ClassicyButton` (padding is skipped for square buttons, as upstream does).
*/
export function ClassicyButton({
active = false,
@@ -39,9 +41,13 @@ export function ClassicyButton({
{...buttonProps}
className={clsx(
'classicyButton',
- isDefault ? 'classicyButtonDefault' : null,
+ // Classicy 3 marks the default button with a bare `default` class (the
+ // ring is drawn by the Platinum appearance package).
+ isDefault ? 'default' : null,
buttonShape === 'square' ? 'classicyButtonShapeSquare' : null,
buttonSize === 'small' ? 'classicyButtonSmall' : null,
+ buttonShape === 'square' ? null : 'classicyButtonPaddingMd',
+ 'classicyButtonMarginMd',
active ? activeClassName : null,
className,
)}
diff --git a/packages/classicyui/src/classicy-checkbox.tsx b/packages/classicyui/src/classicy-checkbox.tsx
index 13b30b4a..da79f2ad 100644
--- a/packages/classicyui/src/classicy-checkbox.tsx
+++ b/packages/classicyui/src/classicy-checkbox.tsx
@@ -50,7 +50,10 @@ export function ClassicyCheckbox({
(null);
+ const portalContainer = useClassicyPortalContainer();
const [position, setPosition] = useState(
CLASSICY_POPOVER_DEFAULT_POSITION,
);
@@ -171,7 +173,7 @@ export function ClassicyPopover({
>
{children}
,
- document.body,
+ portalContainer ?? document.body,
);
}
diff --git a/packages/classicyui/src/classicy-portal-container.ts b/packages/classicyui/src/classicy-portal-container.ts
new file mode 100644
index 00000000..6633dde6
--- /dev/null
+++ b/packages/classicyui/src/classicy-portal-container.ts
@@ -0,0 +1,17 @@
+import { createContext, useContext } from 'react';
+
+/**
+ * Holds the Platinum appearance scope element rendered by `ClassicyRuntimeProvider`.
+ * Not from Micropolis C: browser portal plumbing for the React runtime chrome.
+ */
+export const ClassicyPortalContainerContext = createContext(null);
+
+/**
+ * Returns the element portaled runtime overlays (tooltips, popovers) should mount
+ * into so they stay inside the Platinum appearance scope, or `null` before the
+ * scope element mounts (callers fall back to `document.body`).
+ * Not from Micropolis C: browser portal plumbing for the React runtime chrome.
+ */
+export function useClassicyPortalContainer(): HTMLElement | null {
+ return useContext(ClassicyPortalContainerContext);
+}
diff --git a/packages/classicyui/src/classicy-runtime.tsx b/packages/classicyui/src/classicy-runtime.tsx
index 089e86aa..66759149 100644
--- a/packages/classicyui/src/classicy-runtime.tsx
+++ b/packages/classicyui/src/classicy-runtime.tsx
@@ -1,42 +1,78 @@
-import { ClassicyAppManagerProvider } from 'classicy';
-import type { ComponentProps } from 'react';
+// Importing the Platinum package registers it with the Classicy core and injects
+// its stylesheet and fonts. The core injects its own base stylesheet on import.
+import { PLATINUM_APPEARANCE_PACKAGE_ID } from '@classicy/appearance-platinum';
+import { ClassicyAppManagerProvider } from '@classicy/classicy';
+import { type ComponentProps, useState } from 'react';
-import classicyCssText from '../node_modules/classicy/dist/classicy.css?raw';
-
-const CLASSICY_STYLE_ELEMENT_ID = 'classicy-runtime-style-sheet';
+import { ClassicyPortalContainerContext } from './classicy-portal-container.ts';
export interface ClassicyRuntimeProviderProps extends ComponentProps<
typeof ClassicyAppManagerProvider
> {}
+const CLASSICY_LAYER_ORDER_STYLE_ELEMENT_ID = 'classicy-runtime-layer-order';
+
/**
- * Ensures the Classicy stylesheet is present once for runtime chrome rendering.
- * Mirrors global widget style loading used by the Micropolis Tcl UI bootstrap in
- * `ref/micropolis/res/micropolis.tcl`.
- * Parity note: this injects CSS text into the browser document instead of sourcing Tcl files.
+ * Pins the cascade layer order so Classicy outranks every Tailwind layer.
+ * Not from Micropolis C: browser CSS plumbing for the React runtime chrome.
+ *
+ * Classicy 3 wraps its CSS in `@layer classicy.*` and prepends its `