Skip to content

refactor(design-system): fold CSS prelude into styles.base.css#17

Merged
visomi-dev merged 2 commits into
mainfrom
feat/OC/css-base-prelude-merge
Jun 29, 2026
Merged

refactor(design-system): fold CSS prelude into styles.base.css#17
visomi-dev merged 2 commits into
mainfrom
feat/OC/css-base-prelude-merge

Conversation

@visomi-dev

Copy link
Copy Markdown
Owner

Summary

The same CSS prelude (4× @fontsource/*, @import 'tailwindcss', and @custom-variant dark(...)) was duplicated across the three web app entry stylesheets: apps/web/app/src/styles.css, apps/web/site/src/styles/global.css, and apps/web/ui-designer/src/preview/preview.css. Each of them also imported styles.base.css from the workspace root, so the prelude ended up being declared in four places.

This PR folds the prelude into styles.base.css so each app stylesheet only needs to import the base and declare its own overrides. Order follows the design-system guidance (docs/agents/design-system.md): fonts first, then Tailwind, then the variant.

Changes

  • styles.base.css — add 8 lines at the top: four @import '@fontsource/...';, @import 'tailwindcss';, and @custom-variant dark (&:where(.dark, .dark *));. Existing token block, utilities, and selectors unchanged.
  • apps/web/app/src/styles.css — drop 8 duplicated lines, keep @import '../../../../styles.base.css'; and the app-specific html/body/button/input/textarea/select/a/.sr-only overrides.
  • apps/web/site/src/styles/global.css — drop 8 duplicated lines, keep @import '../../../../../styles.base.css'; and the body transition / upward keyframes.
  • apps/web/ui-designer/src/preview/preview.css — drop the local @import 'tailwindcss'; and @custom-variant, keep @import '../../../../../styles.base.css';, the local @source '../prototypes/*.html'; (preview-only), and the preview chrome overrides.

Verification

pnpm nx run app:build                   ✔ built dist/apps/web/app
pnpm nx run site:build                  ✔ built dist/apps/web/site
pnpm nx run ui-designer:build           ✔ built dist/apps/web/ui-designer
pnpm nx run ui-designer:build-css       ✔ produced dist/.../public/tailwind.css (23 @font-face + 462 --tw-* selectors)
pnpm nx run app:lint                    ✔ All files pass linting
pnpm nx run site:lint                   ✔ no errors
pnpm nx run ui-designer:lint            ✔ 0 errors (1 pre-existing warning)
pnpm nx run app-e2e:e2e                 ✔ 44/44 passed
pnpm nx run api-e2e:e2e                 ✔ 4/4 passed
pnpm nx run server-e2e:e2e              ✔ 4/4 passed
pnpm nx run worker-e2e:e2e              ✔ 1/1 passed
pnpm nx run realtime-e2e:e2e            ✔ 1/1 passed
pnpm nx run site-e2e:e2e                ✔ 2/2 passed
pnpm exec prettier --check              ✔ on the 4 changed files

Bundle inspection confirms Tailwind v4 picks up the prelude through the transitive @import chain in all three apps:

  • dist/apps/web/app/browser/en/styles-*.css contains the 4 @font-family declarations (Inter, Manrope, JetBrains Mono, Material Symbols Outlined) plus --tw-* utilities.
  • dist/apps/web/site/client/_astro/base-layout.*.css contains the same.
  • dist/apps/web/ui-designer/public/tailwind.css contains 23 @font-face blocks and 462 --tw-* selectors.

Risks

None. Pure refactor, identical byte-content in the output bundles. Verified by inspecting the @font-face and --tw-* markers in all three output bundles.

Follow-ups (out of scope)

  • The duplicated html, body { min-height: 100% } + button/input/textarea/select/a reset rules in apps/web/app/src/styles.css and apps/web/ui-designer/src/preview/preview.css could move into styles.base.css as a follow-up; intentionally not done here to keep this PR scoped to the prelude only.

🤖 Generated with opencode

Audit and polish the surfaces left inconsistent by the Catalyst utility-first refactor series. The review follows the web-design-reviewer workflow: capture a baseline, audit drift, apply fixes, re-capture, and ship recordings as evidence.

PR1: replace `font-display` with `font-heading` across the auth routes, the brand wordmark, and the recipes doc. The canonical heading utility per tokens.md is `font-heading`.

PR2: tighten the `app-auth-layout` sticky header. Drop duplicate background utilities, make sticky behavior unconditional so the chrome stays reachable on mobile after scroll, replace `min-h-[calc(100vh-64px)]` with `min-h-dvh`.

PR3: tighten `app-auth-card` mobile padding to a 24px floor. Add `data-od-id="submit"` to every auth route's primary CTA and `data-od-id="brand"` to the brand link for visual e2e.

PR4: add `scripts/capture-ui-snapshots.cjs` driving a structured snapshot grid (12 site PNGs + 60 auth PNGs) against a single BASE_URL, regenerate auth flow recordings, bump version to 1.5.0, update roadmap.

Bonus: fix activation page tab bindings. The previous `[class.bg-white dark:bg-zinc-950]` threw `InvalidCharacterError` in Angular's renderer on every SSR render.

Follow recipes.md: split each multi-class binding into per-mode `[class.X]` entries. Replaces the retired `text-accent` token with `text-blue-600` / `dark:text-blue-500` per tokens.md. Unblocks 2 activation e2e specs.

Verification: app:lint, app:typecheck, app:vite:test, site:lint, ui-designer:lint, app-e2e:e2e (44/44), site-e2e:e2e all pass.

Static guards confirm zero `font-display`, zero duplicate auth layout utilities, zero broken multi-class bindings, and the expected `data-od-id` hook counts.

See docs/specs/2026-06-27-post-refactor-ui-review/ for the full SDD.
Move the shared font imports, @import 'tailwindcss', and
@custom-variant dark(...) prelude that was duplicated across
apps/web/app/src/styles.css, apps/web/site/src/styles/global.css,
and apps/web/ui-designer/src/preview/preview.css into the
workspace-root styles.base.css so each app stylesheet only needs to
import the base and declare its own overrides.

Order in styles.base.css follows the existing design-system guidance
(fonts first, then Tailwind), and ui-designer keeps its own @source
directive in preview.css since that directive is local to the
preview app's HTML scanning.

Verified with app:build, site:build, ui-designer:build,
ui-designer:build-css, and lint for all three projects; all three
output bundles still emit the expected @font-face declarations and
--tw-* utilities picked up through the transitive import chain.
@visomi-dev visomi-dev merged commit a281877 into main Jun 29, 2026
3 checks passed
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