feat: #3639239 Let the Drupal Canvas brand kit override the theme colours
The theme's light-mode :root colour variables beat the Drupal Canvas brand kit, whose :root { --bs-primary: ... } loads before the theme CSS. This lowers only those colours to zero specificity, so the brand kit wins with Canvas's CSS order unchanged.
Issue: https://www.drupal.org/i/3639239 Needed by: educare!109 (Educare brand kit, #3638670). Release this first.
- A PostCSS step in
webpack.config.components.jsmoves the colour custom properties of the:root, [data-bs-theme=light]rule into:where(:root, [data-bs-theme="light"]). The theme's values stay the fallback. - Fonts, radii, shadows, focus ring and other non-colour variables keep normal specificity. Dark mode untouched. Bootstrap's own
_root.scssis used unchanged. components/base/root/root.cssrebuilt: every declaration identical, only the grouping changed. The earlier load-order hook is reverted, so no PHP change remains.
Tested on the dev site: Canvas brand kit CSS still loads before the theme CSS; default look 0 differences on 3 pages; Primary and Body background set in the brand kit follow (:root values, buttons, body background) with CSS aggregation on and off, and in the Canvas editor preview. Educare's .btn-primary uses the theme's own accent, so it does not follow Primary (unchanged from before).
AI-Generated: Yes
Checkpoints:
- File an issue
- Addition/Change/Update/Fix
- Testing to ensure no regression
- Automated unit testing coverage
- Automated functional testing coverage
- UX/UI designer responsibilities
- Readability
- Accessibility
- Performance
- Security
- Developer Documentation
- User Guide Documentation
- Reviewed by human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release notes snippet
- Release