Skip to content
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

Fix z-index & wrong CSS #1094

Merged
merged 9 commits into from
Aug 28, 2017
Merged
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
32 changes: 31 additions & 1 deletion demos/dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,29 @@ <h2 id="mdc-dialog-default-label" class="mdc-dialog__header__title">
</div>
<div class="mdc-dialog__backdrop"></div>
</aside>

<aside id="mdc-dialog-colored-footer-buttons"
class="mdc-dialog"
role="alertdialog"
aria-hidden="true"
aria-labelledby="mdc-dialog-colored-footer-button-label"
aria-describedby="mdc-dialog-colored-footer-button-description">
<div class="mdc-dialog__surface">
<header class="mdc-dialog__header">
<h2 id="mdc-dialog-colored-footer-button-label" class="mdc-dialog__header__title">
Use Google's location service?
</h2>
</header>
<section id="mdc-dialog-colored-footer-button-description" class="mdc-dialog__body">
Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.
</section>
<footer class="mdc-dialog__footer">
<button type="button" class="mdc-button mdc-dialog__footer__button mdc-dialog__footer__button--cancel">Decline</button>
<button type="button" class="mdc-button mdc-dialog__footer__button mdc-dialog__footer__button--accept mdc-dialog__action">Accept</button>
</footer>
</div>
<div class="mdc-dialog__backdrop"></div>
</aside>

<aside id="mdc-dialog-with-list"
class="mdc-dialog"
Expand Down Expand Up @@ -151,6 +174,7 @@ <h2 id="mdc-dialog-with-list-label" class="mdc-dialog__header__title">
</div>
<section class="example">
<button id="default-dialog-activation" class="mdc-button mdc-button--primary mdc-button--raised">Show Dialog</button>
<button id="colored-footer-button-dialog-activation" class="mdc-button mdc-button--primary mdc-button--raised">Show Colored Footer Button Dialog</button>
<button id="dialog-with-list-activation" class="mdc-button mdc-button--primary mdc-button--raised">Show Scrolling Dialog</button>
<div class="mdc-form-field">
<div class="mdc-checkbox">
Expand Down Expand Up @@ -234,7 +258,12 @@ <h2 id="mdc-dialog-default-label" class="mdc-dialog__header__title">
document.querySelector('#dialog-with-list-activation').addEventListener('click', function (evt) {
dialogScrollable.lastFocusedTarget = evt.target;
dialogScrollable.show();
});
});
var dialogColoredButton = new mdc.dialog.MDCDialog(document.querySelector('#mdc-dialog-colored-footer-buttons'));
document.querySelector('#colored-footer-button-dialog-activation').addEventListener('click', function (evt) {
dialogColoredButton.lastFocusedTarget = evt.target;
dialogColoredButton.show();
});
})();
</script>
<script>
Expand All @@ -255,6 +284,7 @@ <h2 id="mdc-dialog-default-label" class="mdc-dialog__header__title">
setTimeout(function() {
mdc.ripple.MDCRipple.attachTo(document.querySelector('#default-dialog-activation'));
mdc.ripple.MDCRipple.attachTo(document.querySelector('#dialog-with-list-activation'));
mdc.ripple.MDCRipple.attachTo(document.querySelector('#colored-footer-button-dialog-activation'));
}, 200);
})();
</script>
Expand Down
3 changes: 2 additions & 1 deletion packages/mdc-dialog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,14 @@ They only need to match the values set for their corresponding aria attributes.

Dialog actions use system colors by default, but you can use a contrasting color, such as the palette’s secondary color, to distinguish dialog actions from dialog content. To emphasize an action from other contents, add `mdc-dialog__action` to `mdc-button` to apply secondary color.

```
```html
<aside class="mdc-dialog">
<div class="mdc-dialog__surface">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs closing </div> in example

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Just fixed it.

<footer class="mdc-dialog__footer">
<button type="button" class="mdc-button mdc-dialog__footer__button mdc-dialog__footer__button--cancel">Decline</button>
<button type="button" class="mdc-button mdc-dialog__footer__button mdc-dialog__footer__button--accept mdc-dialog__action">Accept</button>
</footer>
 </div>
</aside>
```

Expand Down
8 changes: 4 additions & 4 deletions packages/mdc-dialog/mdc-dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $mdc-dialog-dark-theme-bg-color: #303030 !default;
width: 100%;
height: 100%;
visibility: hidden;
z-index: 2;
z-index: 5;

&__backdrop {
position: fixed;
Expand Down Expand Up @@ -141,10 +141,10 @@ $mdc-dialog-dark-theme-bg-color: #303030 !default;
@include mdc-rtl-reflexive-box(margin, right, 0);
}
}
}

&__action {
@include mdc-theme-prop(color, secondary);
}
&__action {
@include mdc-theme-prop(color, secondary);
}

// TODO: Replace with breakpoint variable
Expand Down