feat: #3639241 Let the Drupal Canvas brand kit override the theme colours

The theme's :root colour variables beat the Drupal Canvas brand kit, whose :root { --bs-primary: ... } loads before the theme CSS. This imports Bootstrap's root inside a cascade layer, so the brand kit wins with Canvas's CSS order unchanged.

Issue: https://www.drupal.org/i/3639241 Needed by: rightup!104 (merged) (The Rightup brand kit, #3638673). Release this first.

  • root.scss wraps Bootstrap's root import in @layer vartheme-root { ... }, and the theme's own accent and tertiary light colour variables after it go in the same layer. A layer loses to the brand kit, which is in none, whatever the load order, so the theme values stay the fallback. Everything else stays unlayered.
  • components/base/root/root.css rebuilt: every custom property identical to the target branch, only wrapped in the layer. The copied _bootstrap-root.scss partial and the earlier load-order hook are gone; no PHP change.

Tested on the dev site: default look identical to the target branch on 2 pages (computed colours of every element); Primary set to #0f766e in the brand kit follows on :root and .btn-primary with CSS aggregation on and off; dark values still apply inside [data-bs-theme="dark"].

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
Edited by Rajab Natshah

Merge request reports

Loading
Loading