fix(type): re-emit --wcss-body-weight as backward-compat alias#284
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a backward-compatible alias for the deprecated --wcss-body-weight custom property by re-emitting it from the shared body CSS vars mixin, and bumps generated SassDoc documentation to v11.1.0. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
🚀 PR Release Published! To install: npm install @aurodesignsystem-dev/webcorestylesheets@0.0.0-pr284.0Install via alias: npm install @aurodesignsystem@npm:@aurodesignsystem-dev/webcorestylesheets@0.0.0-pr284.0 |
rmenner
approved these changes
May 13, 2026
Contributor
|
🎉 This PR is included in version 11.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary
--wcss-body-weightper theme as an alias for--wcss-body-default-weightso pre-v11 consumers (notably the bundled CSS inside Auro components likeauro-checkbox,auro-input, etc.) render body text at the correct theme weight again.--wcss-body-{size}-weight) are untouched.alaska,alaska-classic,auro-1,auro-2,hawaiian) automatically, since the alias lives inside the sharedgenerate-body-css-varsmixin invoked once per theme.AB#1556732
Background
WCSS v11.0.0 (5506a19 —
feat: add new body-emphasized classes) removed the theme-wide--wcss-body-weightcustom property and replaced it with per-size variants (--wcss-body-default-weight,--wcss-body-lg-weight, etc.). No alias was kept for backward compatibility.Auro components ship pre-bundled CSS baked into their JS so it can live inside their shadow roots and avoid FOUC. Those bundles were built against pre-v11 WCSS and still reference the old var name with a hard-coded fallback:
Under v11 the var is undefined, the
450literal (Alaska body weight) wins, and every non-Alaska theme renders body text at the wrong weight. On Hawaiian the browser snaps toSlatePro-Mediuminstead ofSlatePro-Regular, which is the user-visible bug.This patch restores the legacy var as an alias so existing Auro component bundles render correct weights immediately — no component rebuild required. Follow-up work to migrate components to the new var names is tracked separately; the alias will be removed in the next WCSS major.
Change
Single addition to the
generate-body-css-varsmixin insrc/type/partials/_body.scss:Using
var(--…-body-default-weight)(rather than re-resolving the theme map) keeps the alias automatically in sync with the per-theme default weight emitted just above.Testing
npm packLocal verification — WCSS
--wcss-body-weightalias fixThe Auro docsite loads theme CSS from
cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest. Until the fix is published, the docsite has no way to see the alias on its own. These steps point the docsite at a local WCSS build so the fix can be verified end-to-end before publish.Why pre-v11 component bundles need the alias
auro-button,auro-dialog,auro-drawer,auro-flight,auro-flightline,auro-pane,auro-popover,auro-toast)--wcss-body-weight450wins → wrong weight on non-Alaska themesauro-formkit/*— checkbox, input, select, etc.)--wcss-body-default-weightThe fix re-emits
--wcss-body-weight: var(--wcss-body-default-weight)per theme so the pre-v11 bundles resolve to the same value the post-v11 bundles already use.Redirect the docsite to local WCSS
The docsite theme switcher hardcodes the CDN URL in
src/components/header/index.js. Apply this temporary diff:Verify in the browser
/components/auro/button.font-weighton visible button label text should resolve to the theme's body weight, not450.SlatePro-Regular(Hawaiian), notSlatePro-Medium.:rootstyles —--wcss-body-weightshould now be defined asvar(--wcss-body-default-weight).Test Plan
npm run buildsucceeds with no errors.--wcss-body-weight: var(--wcss-body-default-weight);— verified indist/bundled/themes/{alaska,alaska-classic,auro-1,auro-2,hawaiian}.global.cssand.global.min.css.npm test).font-weightnow resolves to the Hawaiian default body weight (not450).SlatePro-Regularinstead ofSlatePro-Medium.Summary by Sourcery
Add a backward-compatible body font-weight custom property alias and bump documentation to v11.1.0.
Bug Fixes:
Documentation: