feat: Set up contextual tokens for web components#21934
Conversation
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21934 +/- ##
==========================================
+ Coverage 94.88% 94.89% +0.01%
==========================================
Files 535 537 +2
Lines 43631 43719 +88
Branches 6210 6182 -28
==========================================
+ Hits 41398 41486 +88
Misses 2105 2105
Partials 128 128
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com>
7bbd235 to
71b161a
Compare
|
The layout context system is set up and working in this PR — cds-accordion is a great example of a component that already responds correctly since it reads --cds-layout-size-height-context directly. However components like cds-button, cds-tag, and cds-text-input hardcode a default size which overrides the layout context cascade — this needs to be addressed systematically across all components in a follow-up issue to avoid unintended regressions. |
@riddhybansal Could you open an issue for this, if needed, and link it here? |
maradwan26
left a comment
There was a problem hiding this comment.
LGTM! Tested locally with an implementation for Search too and works 🚀
|
Here is the follow up issue to track the systematic onboarding of all components to the layout context system. |
9bd16c5
|
Hey there! v11.105.0 was just released that references this issue/PR. |
…em#21934) * feat: set up contextual tokens for web components * Update packages/web-components/src/components/layout/layout.ts Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com> * feat: added test cases * feat: added globals in dev mode * fix: cleanup * fix: copywright * fix: docs * feat: added test cases for layout styles --------- Co-authored-by: Taylor Jones <tay1orjones@users.noreply.github.com>
Closes #21740
Closes #21958
Set up initial support for contextual layout tokens in @carbon/web-components
Changelog
New
Added cds-layout component that sets layout context (size and density) for all descendant Carbon web components
Added cds-layout-constraint component for restricting size/density range of descendant components within composite components
Testing / Reviewing
- Verify accordion items render at different heights for sm vs lg layout context
- Verify text inputs render at different heights for sm vs lg layout context
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
More details can be found in the pull request guide