Skip to content

fix(next-styles): the complete sheet is built from the app's own Tailwind content CU-17tkuw62qwh - #2937

Merged
pavlo-flamingo merged 1 commit into
mainfrom
fix/route-styles-full-sheet
Nov 2, 2026
Merged

pavlo-flamingo merged 1 commit into
mainfrom
fix/route-styles-full-sheet

Conversation

@pavlo-flamingo

@pavlo-flamingo pavlo-flamingo commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem. Since #2918 the complete sheet (next-styles/full-*.css) holds no Tailwind utilities: on OpenFrame (frontend main after #776, lib 0.0.838) it is 8 KB of globals and xterm, so everything a page renders after paint (the signed-in shell, menus, panels, client navigation) is unstyled.

Cause. The route step now runs inside next build, under NEXT_STYLES=routes. The Tailwind config it loads is therefore the one withRouteStylesTailwind wrapped for the root sheet, with empty content, and fullSheet(null) builds from that.

Fix. withRouteStylesTailwind keeps the app config under Symbol.for('next-styles.app-tailwind-config'); stylesheetBuilder builds from it when present. Test: the complete sheet carries the app's utilities while NEXT_STYLES=routes (red before the fix).

Checked on a frontend main build with these two scripts dropped into 0.0.838: full-*.css 8 KB → 282 KB raw (27 KB brotli), .flex/.hidden/.bg-ods-bg/content-md: present, standalone copy included.

Change-Set: fix-route-styles-full-sheet

Change set flamingo-stack/fix-route-styles-full-sheet: these pull requests are one change, reviewed together.

Linked work

Linked by the Depends-On / Change-Set lines in these descriptions; this block is maintained by the hub.

…wind content CU-17tkuw62qwh

The route step runs inside next build since #2918, under NEXT_STYLES=routes, so the
config it loaded was the root-sheet one with empty content: the complete sheet held
no utilities and every page lost what it renders after paint. withRouteStylesTailwind
now keeps the app config, and the route step builds the complete sheet from it.
@pavlo-flamingo pavlo-flamingo added the build Run the PR builds and publish snapshots (Java, npm preview); stays on until removed label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

🦩 Flamingo Code Review

✅ No findings on the current head.

Advisory: findings do not block the merge.

Files Lines 🔴 Action required 🟠 Recommended 🔵 Informational
4 +68 / -6 0 0 0

✅ What this change does well

  • route-styles.test.ts adds an end-to-end test that actually runs stylesheetBuilder under NEXT_STYLES=routes through a real tailwind.config.cjs wrapped by withRouteStylesTailwind, directly verifying the new APP_TAILWIND_CONFIG round-trip rather than just unit-testing the wrapper in isolation.
  • style-sources.cjs documents in a doc comment exactly why the fix works (route build runs under the same NEXT_STYLES=routes env, so the wrapped config is what gets loaded), making the non-obvious symbol-based side channel easy to follow later.
  • The fallback loaded[APP_TAILWIND_CONFIG] ?? loaded in route-styles.cjs keeps backward compatibility for configs not wrapped by withRouteStylesTailwind, avoiding a breaking change to callers that pass a plain config.
  • route-styles.cjs now recovers the app's real Tailwind content/safelist via APP_TAILWIND_CONFIG so the complete sheet built under NEXT_STYLES=routes is no longer empty, and the new test in route-styles.test.ts (the 'complete sheet under next-styles build' describe block) exercises exactly that regression.

Review again. New commits are not reviewed until you ask:

  • Review the new commits: only what was pushed since this review
  • Review the whole diff again: everything, including what was already reviewed

Or comment @flamingo-review (new commits) or @flamingo-review full (everything). Add the flamingo-review-always label to review every push.

Updated 2026-11-02 15:37 UTC · reviewed from Pavlo Shylo's machine

@pavlo-flamingo
pavlo-flamingo added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@pavlo-flamingo
pavlo-flamingo added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit c48f47f Nov 2, 2026
30 of 36 checks passed
@pavlo-flamingo
pavlo-flamingo deleted the fix/route-styles-full-sheet branch November 2, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Run the PR builds and publish snapshots (Java, npm preview); stays on until removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants