-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[MDL2]: Dialog, Overlay fixes #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
de3144e
54ad123
dc9418c
e506c81
16477b2
98aa970
2c40be2
0d08a2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,113 +7,194 @@ | |
| // -------------------------------------------------- | ||
| // Dialog styles | ||
|
|
||
| $Dialog-lgHeader-backgroundColor: $ms-color-themePrimary; | ||
| $Dialog-default-min-width: 288px; | ||
| $Dialog-default-max-width: 340px; | ||
|
|
||
| // Mixin for IE9 specific styles | ||
| @mixin dialogPositioningIE9Fallback { | ||
| vertical-align: middle; | ||
| display: inline-block; | ||
| } | ||
|
|
||
| .ms-Dialog { | ||
| @include ms-baseFont; | ||
| @include drop-shadow(0, 0, 5px, 0, .4); | ||
| background-color: transparent; | ||
| position: fixed; | ||
| height: 100%; | ||
| width: 100%; | ||
| top: 0; | ||
| @include left(0); | ||
|
|
||
| // Fallback for IE9 | ||
| display: block; | ||
| font-size: 0; | ||
| line-height: 100vh; | ||
| text-align: center; | ||
|
|
||
| // Flexbox for Modern Browsers | ||
| @include flexBox(); | ||
| @include alignItems(center); | ||
|
|
||
| &::before { | ||
| @include dialogPositioningIE9Fallback(); | ||
| content: ""; | ||
| height: 100%; | ||
| width: 0; | ||
| } | ||
|
|
||
| .ms-Button.ms-Button--compound { | ||
| display: block; | ||
| @include margin-left(0); | ||
| } | ||
|
|
||
| .ms-Overlay { | ||
| @media screen and (-ms-high-contrast: active) { | ||
| opacity: 0; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // The actual dialog element | ||
| .ms-Dialog-main { | ||
| @include dialogPositioningIE9Fallback(); | ||
| @include drop-shadow(); | ||
| background-color: $ms-color-white; | ||
| box-sizing: border-box; | ||
| line-height: 1.35; | ||
| margin: auto; | ||
| width: $Dialog-default-min-width; | ||
| position: relative; | ||
| @include text-align(left); | ||
| outline: 3px solid transparent; | ||
| } | ||
|
|
||
| // Close button, hidden by default | ||
| .ms-Dialog-button.ms-Dialog-button--close { | ||
| display: none; | ||
| height: auto; | ||
| min-width: 220px; | ||
| max-width: 340px; | ||
| padding: 28px 24px; | ||
| z-index: $ms-zIndex-front; | ||
| position: absolute; | ||
| transform: translate(-50%, -50%); | ||
| left: 50%; | ||
| top: 50%; | ||
| @include margin-right(8px); | ||
| padding: 8px; | ||
|
|
||
| .ms-Icon.ms-Icon--Cancel { | ||
| color: $ms-color-neutralSecondary; | ||
| font-size: 16px; | ||
| } | ||
| } | ||
|
|
||
| .ms-Dialog.is-open { | ||
| display: block; | ||
| .ms-Dialog-inner { | ||
| height: 100%; | ||
| padding: 0 28px 20px; | ||
| } | ||
|
|
||
| .ms-Dialog-header { | ||
| position: relative; | ||
| display: table-row; | ||
| width: 100%; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| .ms-Dialog-title { | ||
| font-size: $ms-font-size-xl; | ||
| font-weight: $ms-font-weight-light; | ||
| margin-bottom: 24px; | ||
| margin: 0; | ||
| display: table-cell; | ||
| @include ms-font-xl; | ||
| padding: 20px 28px 20px; | ||
| width: 100%; | ||
| } | ||
|
|
||
| .ms-Dialog-topButton { | ||
| display: table-cell; | ||
| padding: 1px; | ||
| } | ||
|
|
||
| .ms-Dialog-content { | ||
| position: relative; | ||
| width: 100%; | ||
|
|
||
| // Add margin bottom between compound buttons | ||
| .ms-Button.ms-Button--compound:not(:last-child) { | ||
|
||
| margin-bottom: 20px; | ||
| } | ||
| } | ||
|
|
||
| .ms-Dialog-subText { | ||
| color: $ms-color-neutralPrimary; | ||
| font-size: $ms-font-size-s; | ||
| margin: 0 0 20px 0; | ||
| padding-top: 8px; | ||
| @include ms-font-s; | ||
| font-weight: $ms-font-weight-semilight; | ||
| line-height: 1.5; | ||
| } | ||
|
|
||
| .ms-Dialog-actions { | ||
| margin-top: 24px; | ||
| text-align: right; | ||
| position: relative; | ||
| width: 100%; | ||
| min-height: 24px; | ||
| line-height: 24px; | ||
| margin: 20px 0 0; | ||
| font-size: 0; | ||
|
|
||
| .ms-Button { | ||
| line-height: normal; | ||
| } | ||
| } | ||
|
|
||
| //= Modifier: Multiline button dialog | ||
| // Negative margin to needed to compensate for symmetric | ||
| // padding between action elements. | ||
| .ms-Dialog-actionsRight { | ||
| @include text-align(right); | ||
| @include margin-right(-4px); | ||
| font-size: 0; | ||
|
|
||
| // Reset spacing for first button | ||
| .ms-Dialog-action { | ||
| margin: 0px 4px; | ||
| } | ||
| } | ||
|
|
||
| //= Modifier: Dialog with close button | ||
| // | ||
| .ms-Dialog--multiline { | ||
| .ms-Dialog-title { | ||
| font-size: $ms-font-size-xxl; | ||
| .ms-Dialog.ms-Dialog--close:not(.ms-Dialog--lgHeader) { | ||
| // Show the close button | ||
| .ms-Dialog-button.ms-Dialog-button--close { | ||
| display: block; | ||
| } | ||
| } | ||
|
|
||
| //= Modifier: Large header dialog | ||
| //= Modifier: Multiline button dialog | ||
| // | ||
| .ms-Dialog.ms-Dialog--lgHeader { | ||
| .ms-Dialog.ms-Dialog--multiline { | ||
| .ms-Dialog-title { | ||
| background-color: $ms-color-themePrimary; | ||
| color: $ms-color-white; | ||
| font-size: $ms-font-size-xxl; | ||
| font-weight: $ms-font-weight-light; | ||
| padding: 28px 24px; | ||
| margin-top: -28px; | ||
| margin-left: -24px; | ||
| margin-right: -24px; | ||
| } | ||
| } | ||
|
|
||
| // Close button, hidden by default | ||
| .ms-Dialog-buttonClose { | ||
| background: none; | ||
| border: 0; | ||
| cursor: pointer; | ||
| margin: 0; | ||
| padding: 4px; | ||
| position: absolute; | ||
| right: 12px; | ||
| top: 12px; | ||
| z-index: $ms-zIndex-front; | ||
|
|
||
| .ms-Icon.ms-Icon--Cancel { | ||
| color: $ms-color-neutralSecondary; | ||
| font-size: 16px; | ||
| .ms-Dialog-inner { | ||
| padding: 0 20px 20px; | ||
| } | ||
| } | ||
|
|
||
| // Add margin bottom between compound buttons | ||
| .ms-Button.ms-Button--compound:not(:last-child) { | ||
| margin-bottom: 20px; | ||
| } | ||
|
|
||
| //= Modifier: Dialog with close button | ||
| //= Modifier: Large header dialog | ||
| // | ||
| .ms-Dialog.ms-Dialog--close:not(.ms-Dialog--lgHeader) { | ||
| // Push the right side over so the icon doesn't overlap the text | ||
| .ms-Dialog.ms-Dialog--lgHeader { | ||
| .ms-Dialog-header { | ||
| background-color: $Dialog-lgHeader-backgroundColor; | ||
| } | ||
|
|
||
| .ms-Dialog-title { | ||
| margin-right: 20px; | ||
| @include ms-font-xxl; | ||
| color: $ms-color-white; | ||
| padding: 26px 28px 28px; | ||
| margin-bottom: 8px; | ||
| } | ||
|
|
||
| // Show the close button | ||
| .ms-Dialog-button.ms-Dialog-buttonClose { | ||
| display: block; | ||
| .ms-Dialog-subText { | ||
| font-size: $ms-font-size-m; | ||
| } | ||
| } | ||
|
|
||
| @media (min-width: $ms-screen-md-min) { | ||
| // Allow wider dialog on larger screens | ||
| .ms-Dialog-main { | ||
| width: auto; | ||
| min-width: 288px; | ||
| max-width: 340px; | ||
| min-width: $Dialog-default-min-width; | ||
| max-width: $Dialog-default-max-width; | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,6 @@ | |
| left: 0; | ||
| right: 0; | ||
| top: 0; | ||
| z-index: $ms-zIndex-Overlay; | ||
|
|
||
| //== Modifier: Hidden overlay | ||
| // | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider removing this, since it will hide elements that don't have a font-size explicitly set (child elements without a font-size will inherit this size). See OfficeDev/office-ui-fabric-js#11