You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CSS cascade-layer priority is locked in by the first mention of each
layer name. With the order statement living at the top of
`shell/style.scss`, other shell SCSS files reached earlier by webpack's
import traversal were registering `shell` before `paragon` and inverting
the intended order. Move the declaration to its own
`shell/layer-order.scss`, loaded first via a dedicated webpack entry.
Also classify named packages by package.json name, where possible.
This makes it more flexible (so that it applies to workspaces, for
instance).
Fixes#246.
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/decisions/0008-stylesheet-import-in-site-config.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ The build pipeline wraps each stylesheet in a CSS cascade layer based on the res
34
34
|`site`| stylesheets outside `node_modules` (the composing site's source) |
35
35
|`brand`|`@(open)?edx/brand*` packages |
36
36
37
-
The order declared at the top of `shell/style.scss`is`@layer paragon, shell, app, site, brand;` so the cascade resolves in that order: `brand` wins over `site`, `site` wins over `app`, `app` wins over `shell`, and `shell` wins over `paragon`.
37
+
The order is declared in `shell/layer-order.scss`as`@layer paragon, shell, app, site, brand;`, so the cascade resolves in that order: `brand` wins over `site`, `site` wins over `app`, `app` wins over `shell`, and `shell` wins over `paragon`.
38
38
39
39
`brand` is last because, in production, brand CSS is injected at runtime via `<link>` tags that bypass webpack entirely and therefore land **unlayered**. Unlayered rules beat every layered rule regardless of declared order, so runtime brand wins over the site's own CSS. Putting build-time brand imports (e.g. a dev harness that `@use`s a brand package directly) in the last layer keeps dev harness behavior consistent with production: brand overrides apply on top of everything the site declares.
0 commit comments