Add forced border-box to Adaptive Cards #4084
Merged
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.
Changelog Entry
Fixed
box-sizing: border-box
to all descendants under Adaptive Cards, by @compulim, in PR #4084Description
Adaptive Cards team assume the host is running in "forced
border-box
" mode, which means all DOM descendants hasbox-sizing: border-box
rule set. Adaptive Cards Designer applied this CSS rule:However, Web Chat is a UI component and we cannot assume our hosting environment has specific non-default values set. The default value in CSS is a non-inheritable
box-sizing: content-box
.Thus, we are adding "forced border-box" mode only for Adaptive Card:
As the CSS rule is not trivial to unset and deeply polluting, this work will restrict us from extending Adaptive Card. However, we have no plans to extend Adaptive Cards.
In case there is a requirement to extend Adaptive Cards in the future, we must bring this issue up to Adaptive Cards team again, and ask them to fix the root cause before we or our web devs could implement any Adaptive Card extensions.
Design
After talking to David from Adaptive Cards team, he asked us to put the Adaptive Card container in "forced border-box" mode.
Specific Changes
.webchat__adaptive-card-renderer * { box-sizing: border-box; }
rule/packages/bundle/dist
, wherewebchat*.js
is locatedCHANGELOG.md
I have updated documentationReview Checklist
Accessibility reviewed (tab order, content readability, alt text, color contrast)Browser and platform compatibilities reviewedz-index
)Documents reviewed (docs, samples, live demo)Internationalization reviewed (strings, unit formatting)package.json
andpackage-lock.json
reviewedSecurity reviewed (no data URIs, check for nonce leak)