Tweak CSS bundling to dedupe more styles - #34371
Merged
Merged
Conversation
Previously all of compound-web & compound-design-tokens were duplicated amongst all the themes rather than just being in `bundle.css`.
Contributor
There was a problem hiding this comment.
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.pcssinto 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.
Contributor
There was a problem hiding this comment.
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-depsis declared in the global layer order, but MapLibre is currently imported intoapp-web, makingapp-depsunused and placing dependency CSS in the app override layer. Importing MapLibre intoapp-depskeeps 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);
Contributor
There was a problem hiding this comment.
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.pcssfile 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;
dbkr
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously all of compound-web & compound-design-tokens were duplicated amongst all the themes rather than just being in
bundle.css.