Skip to content

fix(ui-css): clean renderer css hygiene - #480

Merged
Astro-Han merged 3 commits into
mainfrom
codex/css-hygiene
Jul 3, 2026
Merged

fix(ui-css): clean renderer css hygiene#480
Astro-Han merged 3 commits into
mainfrom
codex/css-hygiene

Conversation

@Astro-Han

@Astro-HanAstro-Han commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a renderer CSS parse contract backed by an explicit postcss dev dependency.
  • Make the contract scan all CSS under apps/desktop/src/renderer, so future sibling CSS files are covered automatically.
  • Remove the dangling nav-sidebar.css text that strict CSS parsers reject.
  • Remove dead [data-theme] selectors and ineffective font token self-references, with narrow regression guards for both patterns.

Why

Part of #476. This is PR1 from the shared post-#430 cleanup roadmap and does not close#476.

The immediate bug is that styles/settings/nav-sidebar.css contains dangling plain text that Tailwind currently tolerates but a strict CSS parser rejects. The same hygiene pass also removes selectors and declarations that never affect runtime behavior, then pins those removals so the bad patterns do not return silently.

Scope

Changed:

  • apps/desktop/src/main/__tests__/renderer-css-parse-contract.test.ts adds a strict parse contract over every renderer CSS file and guards against retired html[data-theme...] selectors plus self-referential font tokens.
  • apps/desktop/src/renderer/styles/settings/nav-sidebar.css removes the dangling partial text line.
  • apps/desktop/src/renderer/styles/theme-glass.css removes unreachable html[data-theme="..."] rules.
  • apps/desktop/src/renderer/maka-tokens.css removes --font-sans / --font-mono self-references.
  • apps/desktop/package.json / package-lock.json declare postcss@8.5.15 directly for the new contract.

Not included:

  • No cascade @layer strategy changes.
  • No !important / input ring-reset changes.
  • No module-pages.css split.
  • No visual redesign.

Verification

  • npm run -w @maka/desktop build:main
  • node --test apps/desktop/dist/main/__tests__/renderer-css-parse-contract.test.js (red before fix: nav-sidebar.css:822 Unknown word inputs; final run: 3 tests pass)
  • Temporary regression checks: re-adding html[data-theme = "dark"] failed the retired selector assertion; re-adding --font-sans: var( --font-sans ); failed the self-reference assertion.
  • node --test apps/desktop/dist/main/__tests__/renderer-tailwind-compile-contract.test.js
  • npm run -w @maka/desktop build:renderer (passes; existing Vite chunk size warning remains)
  • npm run -w @maka/desktop test (1706 tests pass)

User-facing impact

None expected. This removes invalid dangling text, unreachable selectors, and no-op token declarations.

Reviewer notes

Addressed review feedback by removing the hand-written CSS file list and adding regression assertions for the retired patterns, including CSS-equivalent spaced forms. GitHub Checks are still not providing CI evidence on this PR, so the verification above is local.

@Astro-Han
Astro-Han merged commit 147342e into mainJul 3, 2026
@Astro-Han
Astro-Han deleted the codex/css-hygiene branch July 3, 2026 12:11
Sign up for freeto 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.

refactor(ui): CSS architecture debt cleanup (post #430 converge)

1 participant

@Astro-Han