- Keep the application free of runtime
<style>injection in the shipping path. - Use static CSS and explicit module boundaries for ordinary presentation styling.
- Preserve current behavior while keeping CSP compatibility strict.
- The removed runtime style packages are no longer direct dependencies.
src/main.tsxrenders through a static CSS entry plus the Radix Themes root provider.- The Tauri nonce bootstrap and
getCspNoncehelper are gone. - The application entry path no longer depends on a runtime style engine.
- Remaining work is limited to guardrail maintenance, documentation cleanup, and regression prevention.
At the start of the transition, the repository was CSP-sensitive and still had live runtime styling entry points:
src/main.tsxcreated a cache/provider bootstrap for dynamic styles- multiple feature files still used application-owned
styled(...)wrappers - the CSP workaround depended on a nonce to keep desktop production builds working
Because of that, moving away from runtime styling was not a package cleanup. It was an architectural transition.
- keep the application free of runtime
<style>injection - keep
src/main.tsxon static CSS imports and the root provider only - keep desktop production builds compatible with static CSS delivery
- global CSS is limited to reset, app shell, and shared canvas helper rules
- component-owned visual styling lives in colocated
*.module.cssfiles - shared visual tokens are exposed through CSS custom properties
- dynamic geometry remains in narrow, typed boundaries only where static CSS cannot express the behavior
- use shared UI components that do not require a runtime style engine
- keep visual tokens in CSS custom properties and local modules
- keep application-owned
styled(...)wrappers out of the codebase - avoid replacing editor-specific geometry with generic abstractions when the geometry is product-specific
- redesigning the product
- swapping the shared UI library again
- removing every dynamic style value in one patch
- weakening CSP to re-allow runtime style injection
- keep production Tauri styling compatible with static CSS delivery
- do not introduce new runtime
<style>injection paths - keep
pnpm verify:tauri:cspgreen
- make small, mechanical changes
- leave the repository green after every batch
- avoid mixing unrelated state or domain refactors into styling work
- make the static styling direction explicit
- stop adding new application-owned
styled(...)wrappers - stop adding new runtime-style entry points
- prefer
*.module.cssfor new presentational work
- define the CSS architecture rules
- classify what belongs in
global.css, CSS Modules, shared CSS tokens, and typed runtime geometry - keep reviewed exceptions narrow and documented
Start with UI that is already close to stock shared controls:
- common dialogs
- simple form rows and selectors
- palette and inspector cards
- menu bar visual shell
Focus:
- replace application-owned
styled(...)wrappers with direct shared components or CSS Modules - keep behavior and accessibility unchanged
- avoid touching canvas or editor geometry in the same patches
Move feature-local visuals from styles.ts and wrapper-based styling into CSS Modules where safe:
- screen mode shells
- character mode shells
- background mode shells
- shared preview containers
Keep dynamic geometry separate from static skinning:
- static surfaces, spacing, borders, shadows, and typography move to CSS
- dynamic sizes and positions stay in typed runtime boundaries until CSS custom properties can express them cleanly
- remove the final application-owned
styled(...)call sites - simplify
src/main.tsx - remove nonce-based startup helpers that only existed for styling
- keep
verify:securityandverify:tauri:cspaligned with the static path - update docs and tests to reflect the current architecture
- keep CSP verification free of runtime-style assumptions
- write architecture docs and repository-visible guardrails
- add repo tests for those docs
- migrate common dialogs and simple form shells to CSS Modules
- keep shared tokens and semantic component props, remove local wrapper usage where touched
- menu bar styling has already moved off its old wrapper layer and now lives beside the
MenuBarcomponent - keep interaction logic unchanged
- migrate character and screen shared primitives
- isolate runtime geometry values behind CSS custom properties or reviewed style boundaries
- remove final runtime-style entry points
- update CSP docs and verification expectations
- accidental behavior drift while moving style ownership
- hidden runtime
<style>injection from newly introduced UI paths - mixing static CSS cleanup with unrelated editor logic changes
- overusing global selectors instead of component-local scope
pnpm format:checkpnpm lintpnpm typecheck:safetypnpm verify:securitypnpm test- UI-affecting batches:
pnpm test:e2e:console - visible or interaction changes:
pnpm test:e2e - Tauri or CSP-related batches on macOS:
pnpm verify:tauri:csp
The first batch targeted shared UI that already behaved like ordinary application chrome:
src/presentation/components/common/ui/dialogs/PwaUpdateDialog.tsxsrc/presentation/components/common/ui/dialogs/DesktopAutoUpdateDialog.tsxsrc/presentation/components/spriteMode/ui/forms/SpriteModeEditorSelectionFields.tsxsrc/presentation/components/spriteMode/ui/forms/SpriteModePaletteSlots.tsx
These files offered the lowest-risk path to remove application-owned wrapper styling without mixing in editor geometry work.