Skip to content

Tweak CSS bundling to dedupe more styles - #34371

Merged
t3chguy merged 5 commits into
developfrom
t3chguy/tweak-css-bundling
Jul 22, 2026
Merged

Tweak CSS bundling to dedupe more styles#34371
t3chguy merged 5 commits into
developfrom
t3chguy/tweak-css-bundling

Conversation

@t3chguy

@t3chguy t3chguy commented Jul 21, 2026

Copy link
Copy Markdown
Member

Previously all of compound-web & compound-design-tokens were duplicated amongst all the themes rather than just being in bundle.css.

Previously all of compound-web & compound-design-tokens were duplicated amongst all the themes rather than just being in `bundle.css`.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures CSS entry points so shared, non-themed styles are bundled once into bundle.css rather than duplicated across every theme stylesheet.

Changes:

  • Replaces the direct JS import of shared-components CSS with a new shared PostCSS entry (apps/web/res/css/_index.pcss) imported from the main app entrypoint.
  • Removes Compound (tokens/web) imports from each theme stylesheet to avoid per-theme duplication.
  • Moves MapLibre’s CSS import from _common.pcss into the shared bundle entry.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
apps/web/src/vector/index.ts Switches common CSS loading to the new shared _index.pcss entry so it ends up in bundle.css.
apps/web/res/themes/light/css/light.pcss Removes shared imports from the light theme stylesheet.
apps/web/res/themes/light-high-contrast/css/light-high-contrast.pcss Removes shared imports from the light HC theme stylesheet.
apps/web/res/themes/light-custom/css/light-custom.pcss Removes shared imports from the light custom theme stylesheet.
apps/web/res/themes/legacy-light/css/legacy-light.pcss Removes shared imports from the legacy light theme stylesheet.
apps/web/res/themes/legacy-dark/css/legacy-dark.pcss Removes shared imports from the legacy dark theme stylesheet.
apps/web/res/themes/dark/css/dark.pcss Removes shared imports from the dark theme stylesheet.
apps/web/res/themes/dark-custom/css/dark-custom.pcss Removes shared imports from the dark custom theme stylesheet.
apps/web/res/css/rethemendex.sh Updates _components.pcss generation to exclude _index.pcss instead of the removed _compound.pcss.
apps/web/res/css/_index.pcss Adds a new shared CSS entry to centralize compound/shared-components and other shared imports.
apps/web/res/css/_compound.pcss Deletes the previous compound-only CSS entry now superseded by _index.pcss.
apps/web/res/css/_common.pcss Removes MapLibre CSS import (now pulled into the shared _index.pcss).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/web/res/css/_index.pcss Outdated
Comment thread apps/web/res/css/_index.pcss Outdated
Comment thread apps/web/res/themes/light/css/light.pcss
Comment thread apps/web/res/themes/light-custom/css/light-custom.pcss
Comment thread apps/web/res/themes/legacy-light/css/legacy-light.pcss
Comment thread apps/web/res/themes/legacy-dark/css/legacy-dark.pcss
Comment thread apps/web/res/themes/dark/css/dark.pcss
Comment thread apps/web/res/themes/dark-custom/css/dark-custom.pcss

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

apps/web/res/css/_index.pcss:10

  • app-deps is declared in the global layer order, but MapLibre is currently imported into app-web, making app-deps unused and placing dependency CSS in the app override layer. Importing MapLibre into app-deps keeps third-party base styles below app overrides while still above compound/shared-components layers.
@import url("maplibre-gl/dist/maplibre-gl.css") layer(app-web);

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

apps/web/res/css/_index.pcss:8

  • The previous _compound.pcss file documented the intended cascade-layer order and why it matters. Now that the layer definition has moved into _index.pcss, that rationale has been dropped, making it easier to accidentally reorder layers later and introduce subtle styling regressions. Consider restoring at least the high-level comment explaining the intended layer order here.
@layer compound-tokens, compound-web, shared-components, app-web;

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

@t3chguy
t3chguy marked this pull request as ready for review July 22, 2026 08:46
@t3chguy
t3chguy requested a review from a team as a code owner July 22, 2026 08:46
@t3chguy
t3chguy requested review from MidhunSureshR and dbkr July 22, 2026 08:46
@t3chguy
t3chguy added this pull request to the merge queue Jul 22, 2026
Merged via the queue into develop with commit 7e8daab Jul 22, 2026
60 checks passed
@t3chguy
t3chguy deleted the t3chguy/tweak-css-bundling branch July 22, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Task Tasks for the team like planning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants