Skip to content

Commit

Permalink
fix(dialog): Conform more closely with spec (#3575)
Browse files Browse the repository at this point in the history
  • Loading branch information
kfranqueiro committed Sep 19, 2018
1 parent 2e7805b commit 359710d
Show file tree
Hide file tree
Showing 3 changed files with 178 additions and 68 deletions.
24 changes: 23 additions & 1 deletion packages/mdc-dialog/mdc-dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
flex-grow: 1;
box-sizing: border-box;
margin: 0;
padding: 10px 24px 20px;
padding: 20px 24px; // Note: the top padding is only 20px for dialogs without titles; see below for override
overflow: auto;
-webkit-overflow-scrolling: touch;

Expand All @@ -129,6 +129,27 @@
}
}

// stylelint-disable-next-line plugin/selector-bem-pattern
.mdc-dialog__title + .mdc-dialog__content {
// Eliminate padding to bring as close to spec as possible, relying on title padding.
// (Spec seems inconsistent RE title/body spacing on alert vs. simple variants.)
padding-top: 0;
}

// stylelint-disable-next-line plugin/selector-bem-pattern
.mdc-dialog--scrollable .mdc-dialog__content {
// Reduce and equalize vertical paddings when scrollable dividers are present
// (Note: this is intentionally after title + content to take precedence)
padding-top: 8px;
padding-bottom: 8px;
}

// stylelint-disable-next-line plugin/selector-bem-pattern
.mdc-dialog__content .mdc-list:first-child:last-child {
// Override default .mdc-list padding for content consisting exclusively of a MDC List
padding: 0;
}

.mdc-dialog__actions {
display: flex;
position: relative;
Expand Down Expand Up @@ -208,6 +229,7 @@

// postcss-bem-linter: end

// Class applied to body while dialog is open, to prevent scrolling behind the dialog
.mdc-dialog-scroll-lock {
overflow: hidden;
}
Loading

0 comments on commit 359710d

Please sign in to comment.