Skip to content

Commit 5f6085a

Browse files
committed
Split CSS properties here to avoid a bug where 0-ing the padding values causes invalid calc() functions
Fixes #39798, fixes #39370, closes #39873, undoes changes in #39373
1 parent a51aaee commit 5f6085a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

scss/_modal.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@
132132

133133
.btn-close {
134134
padding: calc(var(--#{$prefix}modal-header-padding-y) * .5) calc(var(--#{$prefix}modal-header-padding-x) * .5);
135-
margin: calc(-.5 * var(--#{$prefix}modal-header-padding-y)) calc(-.5 * var(--#{$prefix}modal-header-padding-x)) calc(-.5 * var(--#{$prefix}modal-header-padding-y)) auto;
135+
// Split properties to avoid invalid calc() function if value is 0
136+
margin-top: calc(-.5 * var(--#{$prefix}modal-header-padding-y));
137+
margin-right: calc(-.5 * var(--#{$prefix}modal-header-padding-x));
138+
margin-bottom: calc(-.5 * var(--#{$prefix}modal-header-padding-y));
139+
margin-left: auto;
136140
}
137141
}
138142

scss/_offcanvas.scss

+5-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@
127127

128128
.btn-close {
129129
padding: calc(var(--#{$prefix}offcanvas-padding-y) * .5) calc(var(--#{$prefix}offcanvas-padding-x) * .5);
130-
margin: calc(-.5 * var(--#{$prefix}offcanvas-padding-y)) calc(-.5 * var(--#{$prefix}offcanvas-padding-x)) calc(-.5 * var(--#{$prefix}offcanvas-padding-y)) auto;
130+
// Split properties to avoid invalid calc() function if value is 0
131+
margin-top: calc(-.5 * var(--#{$prefix}offcanvas-padding-y));
132+
margin-right: calc(-.5 * var(--#{$prefix}offcanvas-padding-x));
133+
margin-bottom: calc(-.5 * var(--#{$prefix}offcanvas-padding-y));
134+
margin-left: auto;
131135
}
132136
}
133137

0 commit comments

Comments
 (0)