[GH-ISSUE #1578] [Feature]: Reduce or intentionally budget the main CSS asset #817

Closed
opened 2026-10-21 05:21:29 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @Xelvanis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1578

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

pnpm build currently emits a main CSS asset over 500 kB:

  • dist/assets/index-DFM6BbNV.css: 510.48 kB, gzip 63.18 kB

The repo also has a configured size-limit CSS budget of 250 kB for dist/assets/*.css, so the current main CSS size needs either reduction or an explicit budget decision.

Source-size clues from the current checkout:

  • src/styles/globals.css: 99.57 kB source
  • src/styles/themes/sillytavern.css: 17.43 kB source
  • tracker component CSS files together contribute roughly 75 kB source
  • Tailwind generates global utility CSS from the whole app's class usage
  • the built main CSS includes global Tailwind utilities plus feature-specific custom classes/animations such as game text/direction effects and Professor Mari pixel-scene styles

Proposed behavior

Audit the main CSS asset and choose an intentional CSS strategy.

Possible implementation work:

  • move feature-specific custom CSS and animation blocks out of src/styles/globals.css into feature-owned CSS imported by lazy feature chunks where Vite can split it;
  • prune unused or duplicated global theme/style blocks;
  • check whether Tailwind content generation or arbitrary utility usage is inflating the global utility set;
  • decide whether the 250 kB CSS size-limit budget is still the correct target, then make the build and budget agree.

Expected owner or impact area

  • App shell, navigation, startup, or providers
  • Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Refactor branch considerations

CSS changes need visual proof on the native Tauri path for affected surfaces. Do not remove styling just to hit a number; preserve app shell, tracker, roleplay/game presentation, and Professor Mari visuals.

Acceptance checks:

  • pnpm build passes.
  • pnpm exec size-limit passes, or the CSS budget is updated with an explicit rationale.
  • The main CSS asset is below the agreed threshold, or the remaining size is documented as intentional.
  • Native Tauri visual QA covers app shell, tracker/sidebar, roleplay/game surfaces, and Professor Mari after any CSS movement.

Alternatives considered

Raising the CSS budget without auditing would remove the failure pressure but would not tell maintainers whether the CSS is genuinely needed, globally scoped by accident, or better split by feature.

Additional context

This is one implementation slice under #1532.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (May 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1578 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? `pnpm build` currently emits a main CSS asset over 500 kB: - `dist/assets/index-DFM6BbNV.css`: 510.48 kB, gzip 63.18 kB The repo also has a configured `size-limit` CSS budget of 250 kB for `dist/assets/*.css`, so the current main CSS size needs either reduction or an explicit budget decision. Source-size clues from the current checkout: - `src/styles/globals.css`: 99.57 kB source - `src/styles/themes/sillytavern.css`: 17.43 kB source - tracker component CSS files together contribute roughly 75 kB source - Tailwind generates global utility CSS from the whole app's class usage - the built main CSS includes global Tailwind utilities plus feature-specific custom classes/animations such as game text/direction effects and Professor Mari pixel-scene styles ## Proposed behavior Audit the main CSS asset and choose an intentional CSS strategy. Possible implementation work: - move feature-specific custom CSS and animation blocks out of `src/styles/globals.css` into feature-owned CSS imported by lazy feature chunks where Vite can split it; - prune unused or duplicated global theme/style blocks; - check whether Tailwind content generation or arbitrary utility usage is inflating the global utility set; - decide whether the 250 kB CSS `size-limit` budget is still the correct target, then make the build and budget agree. ## Expected owner or impact area - [x] App shell, navigation, startup, or providers - [ ] Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge - [x] Chat mode - [x] Roleplay mode - [x] Game mode - [x] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [x] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Refactor branch considerations CSS changes need visual proof on the native Tauri path for affected surfaces. Do not remove styling just to hit a number; preserve app shell, tracker, roleplay/game presentation, and Professor Mari visuals. Acceptance checks: - `pnpm build` passes. - `pnpm exec size-limit` passes, or the CSS budget is updated with an explicit rationale. - The main CSS asset is below the agreed threshold, or the remaining size is documented as intentional. - Native Tauri visual QA covers app shell, tracker/sidebar, roleplay/game surfaces, and Professor Mari after any CSS movement. ## Alternatives considered Raising the CSS budget without auditing would remove the failure pressure but would not tell maintainers whether the CSS is genuinely needed, globally scoped by accident, or better split by feature. ## Additional context This is one implementation slice under #1532. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@cha1latte commented on GitHub (May 29, 2026):

Triage note: labeling this as scope-risk because CSS reduction may require theme/component style ownership decisions or an intentional budget change.

A good next step is to measure CSS owners and either split/reduce a focused owner or explicitly update the budget.

<!-- gh-comment-id:4578273256 --> @cha1latte commented on GitHub (May 29, 2026): Triage note: labeling this as `scope-risk` because CSS reduction may require theme/component style ownership decisions or an intentional budget change. A good next step is to measure CSS owners and either split/reduce a focused owner or explicitly update the budget.
Author
Owner

@SpicyMarinara commented on GitHub (Jun 1, 2026):

We just need to make our CSS/HTML files cleaner.

<!-- gh-comment-id:4591237361 --> @SpicyMarinara commented on GitHub (Jun 1, 2026): We just need to make our CSS/HTML files cleaner.
Author
Owner

@SpicyMarinara commented on GitHub (Jun 1, 2026):

Closed after re-measuring current refactor output.

Findings:

  • pnpm build passes.
  • Built CSS assets are raw 517.82 KB for index CSS plus 66.38 KB for shell CSS.
  • pnpm exec size-limit passes because the configured CSS budget is measured as brotli size, not raw file size.
  • Current CSS size-limit result: 53.39 KB brotlied against the 250 KB CSS limit.

Decision:

  • No CSS deletion or budget change in this pass. The configured budget is already being enforced and passing; the issue report was based on raw Vite asset size while size-limit reports compressed transfer size.
  • Future CSS cleanup should be sliced by owner with visual QA, not done as blind pruning.

Verification:

  • pnpm build
  • pnpm exec size-limit
<!-- gh-comment-id:4592040800 --> @SpicyMarinara commented on GitHub (Jun 1, 2026): Closed after re-measuring current refactor output. Findings: - pnpm build passes. - Built CSS assets are raw 517.82 KB for index CSS plus 66.38 KB for shell CSS. - pnpm exec size-limit passes because the configured CSS budget is measured as brotli size, not raw file size. - Current CSS size-limit result: 53.39 KB brotlied against the 250 KB CSS limit. Decision: - No CSS deletion or budget change in this pass. The configured budget is already being enforced and passing; the issue report was based on raw Vite asset size while size-limit reports compressed transfer size. - Future CSS cleanup should be sliced by owner with visual QA, not done as blind pruning. Verification: - pnpm build - pnpm exec size-limit
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#817
No description provided.