Force left auto margin to be applied for modal and offcanvas header close buttons #39873
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.
Description
This PR fixes the use case described in #39798 (comment) after a modification done in #39373.
IMHO, we don't need to reintroduce
justify-content: space-between
. Withoutjustify-content: space-between
, it offers more possibilities in terms of compositions for the modals and offcanvases headers. The issue seems to be limited to the special use case described in #39798 (comment).Whenever
$modal-inner-padding
is set to0
(or$modal-header-padding-y
and$modal-header-padding-x
are set to 0), the following shorthand margin rule doesn't apply the auto margin left rule:It works manually when doing:
I suspect an issue with the combination of
calc
and the actual values of the custom properties that could lead maybe to something kind of undefined or invalid. All the intermediate values in the shorthand rule are maybe undefined or invalid, making the entire rule invalid or equal to0
;auto
not being applied for the left-margin. It is evaluated as something likemargin: 0;
in the end.When replacing the shorthand rule by the longhand rule, it seems now to work with the special case setting a 0 value.
Still based on my suspicion, even if the
calc
rules (when setting a value to 0) are undefined or invalid, the longhand version allows having the right value for eachmargin-*
rules:/cc @twbs/css-review for other ideas or a better technical analysis
Type of changes
Checklist
npm run lint
)Live previews
Testing
Related issues
Closes #39798