Skip to content

perf: gui sheet keeps only mounted themes — 350,715 → 79,364 bytes - #46

Closed
zeekay wants to merge 1 commit into
perf/gui-css-staticfrom
perf/gui-used-css
Closed

perf: gui sheet keeps only mounted themes — 350,715 → 79,364 bytes#46
zeekay wants to merge 1 commit into
perf/gui-css-staticfrom
perf/gui-used-css

Conversation

@zeekay

@zeekay zeekay commented Jul 30, 2026

Copy link
Copy Markdown
Member

config.getCSS() emits every color family in the config; the app mounts light/dark only. The gen-gui-css.mjs generator now prunes rules whose selectors all reference unmounted families (blue/red/green/... x light/dark). Runtime cannot re-insert theme CSS (themes hydrate FROM the sheet), so mounted themes are kept whole; a lone .tm_xxt survivor is a dead hydration sentinel and is dropped.

Measured (local prod build, next start):

  • source app/gui.css: 350,715 → 79,364 bytes raw
  • emitted asset: 344,929 → 76,391 raw / 28,222 → 11,666 gzip (before matches live db1557df52833040.css byte-for-byte)
  • playwright pixel diff, 1440x900 + 390x844, full-page: 0 px on /, /features, /pricing, /faq, /docs (hydrated, light-forced and dark) and 0 px on gui-heavy /resources, /test-generation, /games, /playground, /chat (hydrated AND JS-disabled SSR paint; sole exception 2-11 px inside the /chat SSR spinner glyph — animation phase noise).

config.getCSS() emits every color family the config knows (12 families x
light/dark x component sub-themes); this app mounts light/dark only. The
generator now drops rules whose every selector references an unmounted
family — the runtime cannot re-insert theme CSS (themes hydrate FROM this
sheet), so mounted themes stay whole.

Emitted asset: 344,929 → 76,391 raw, 28,222 → 11,666 gzip. Pixel-identical
under playwright on 10 routes x 2 viewports x light+dark, hydrated and
JS-off SSR paint both.

Co-authored-by: Hanzo Dev <dev@hanzo.ai>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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