diff --git a/styles/components/_modal.scss b/styles/components/_modal.scss index 868476b9..98851565 100644 --- a/styles/components/_modal.scss +++ b/styles/components/_modal.scss @@ -29,6 +29,7 @@ flex-grow: 1; overflow-y: auto; max-width: 80rem; + position: relative; @include media($medium-screen) { padding: $gap * 4; @@ -39,9 +40,24 @@ @include h3; } - :first-child { + > :first-child { margin-top: 0; } + + .modal__dismiss { + position: absolute; + top: 0; + right: 0; + width: 8rem; + } + } + } + + &.modal--dismissable { + .modal__body { + > :first-child { + margin-right: 8rem; + } } } } diff --git a/templates/components/modal.html b/templates/components/modal.html index aedebd42..b0bafd12 100644 --- a/templates/components/modal.html +++ b/templates/components/modal.html @@ -2,18 +2,17 @@ {% macro Modal(name, dismissable=False) -%}
-