Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/material/dialog/_m3-dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
dialog-container-small-max-width: calc(100vw - 32px),
dialog-content-padding: 20px 24px,
dialog-headline-padding: 6px 24px 13px,
dialog-with-actions-content-padding: 20px 24px 0,
// The block-end value reserves room for the touch targets of any controls at the end of
// the content, which would otherwise be scrollable overflow. See dialog.scss.
dialog-with-actions-content-padding: 20px 24px 8px,
),
color: (
dialog-container-color: map.get($system, surface),
Expand Down
9 changes: 8 additions & 1 deletion src/material/dialog/dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,15 @@ $fallbacks: m3-dialog.get-tokens();

// Note: we can achieve this with a `:has` selector, but it results in an
// increased specificity which breaks a lot of internal clients.
//
// The block-end padding reserves room for the touch targets of the controls the content may
// contain. Buttons, checkboxes and radios center a 48px touch target on a 40px control and
// slide toggles center one on a 32px switch, so the target overhangs the control by up to
// 8px. Since this element scrolls, an overhanging target at the end of the content is
// scrollable overflow, and the dialog shows a scrollbar over content that fits. Reserving
// the overhang fixes it without shrinking the targets below their accessible size.
.mat-mdc-dialog-container-with-actions & {
padding: token-utils.slot(dialog-with-actions-content-padding, $fallbacks, 20px 24px 0);
padding: token-utils.slot(dialog-with-actions-content-padding, $fallbacks, 20px 24px 8px);
}

.mat-mdc-dialog-container .mat-mdc-dialog-title + & {
Expand Down
Loading