Skip to content

Commit

Permalink
fix(dialog)!: change content margin to padding
Browse files Browse the repository at this point in the history
BREAKING CHANGE: if overriding margin on a dialog's content, swap it to padding. If a dialog's slotted first or last child has built-in margin (such as `<h3>` or `<p>`), remove the top/bottom margin as needed (since margin swapped to padding, there's no more margin collapsing).

PiperOrigin-RevId: 564509429
  • Loading branch information
asyncLiz authored and copybara-github committed Sep 11, 2023
1 parent b50d5c8 commit 8613fe6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions dialog/internal/_dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,10 @@
slot[name='headline']::slotted(*) {
align-items: center;
align-self: stretch;
box-sizing: border-box;
display: flex;
gap: 8px;
margin: 24px 24px 0;
padding: 24px 24px 0;
}

.icon {
Expand All @@ -149,22 +150,22 @@
color: var(--_icon-color);
fill: currentColor;
font-size: var(--_icon-size);
margin-top: 24px;
padding-top: 24px;
height: var(--_icon-size);
width: var(--_icon-size);
}

.has-icon slot[name='headline']::slotted(*) {
justify-content: center;
margin-top: 16px;
padding-top: 16px;
}

.scrollable slot[name='headline']::slotted(*) {
margin-bottom: 16px;
padding-bottom: 16px;
}

.scrollable.has-headline slot[name='content']::slotted(*) {
margin-top: 8px;
padding-top: 8px;
}

.container {
Expand Down Expand Up @@ -217,7 +218,8 @@
}

slot[name='content']::slotted(*) {
margin: 24px;
box-sizing: border-box;
padding: 24px;
}

// Anchors are used with an IntersectionObserver to determine when the content
Expand All @@ -239,14 +241,15 @@
}

slot[name='actions']::slotted(*) {
box-sizing: border-box;
display: flex;
gap: 8px;
justify-content: flex-end;
margin: 16px 24px 24px;
padding: 16px 24px 24px;
}

.has-actions slot[name='content']::slotted(*) {
margin-bottom: 8px;
padding-bottom: 8px;
}

md-divider {
Expand Down

0 comments on commit 8613fe6

Please sign in to comment.