Merge pull request #162 from dod-ccpo/ui/modal-close-button

reposition modal close button
This commit is contained in:
andrewdds 2018-08-13 15:34:41 -04:00 committed by GitHub
commit aad3115093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 10 deletions

View File

@ -29,6 +29,7 @@
flex-grow: 1; flex-grow: 1;
overflow-y: auto; overflow-y: auto;
max-width: 80rem; max-width: 80rem;
position: relative;
@include media($medium-screen) { @include media($medium-screen) {
padding: $gap * 4; padding: $gap * 4;
@ -39,9 +40,24 @@
@include h3; @include h3;
} }
:first-child { > :first-child {
margin-top: 0; margin-top: 0;
} }
.modal__dismiss {
position: absolute;
top: 0;
right: 0;
width: 8rem;
}
}
}
&.modal--dismissable {
.modal__body {
> :first-child {
margin-right: 8rem;
}
} }
} }
} }

View File

@ -2,8 +2,10 @@
{% macro Modal(name, dismissable=False) -%} {% macro Modal(name, dismissable=False) -%}
<div v-if='modals.{{name}} === true' v-cloak> <div v-if='modals.{{name}} === true' v-cloak>
<div class='modal'> <div class='modal {% if dismissable %}modal--dismissable{% endif%}'>
<div class='modal__dialog' role='dialog' aria-modal='true'> <div class='modal__dialog' role='dialog' aria-modal='true'>
<div class='modal__body'>
{{ caller() }}
{% if dismissable %} {% if dismissable %}
<button class='icon-link modal__dismiss' v-on:click='closeModal("{{name}}")'> <button class='icon-link modal__dismiss' v-on:click='closeModal("{{name}}")'>
@ -11,9 +13,6 @@
<span>Close</span> <span>Close</span>
</button> </button>
{% endif %} {% endif %}
<div class='modal__body'>
{{ caller() }}
</div> </div>
</div> </div>
</div> </div>