From 84cdeb9b03fd6cc32d697d99a26f6abf91998351 Mon Sep 17 00:00:00 2001 From: zombieFox Date: Sun, 14 Jun 2020 14:32:53 +0100 Subject: [PATCH] [design] improve modal body padding --- src/css/modal.css | 5 ++++- src/js/modal.js | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/css/modal.css b/src/css/modal.css index b583c794..5ab06522 100755 --- a/src/css/modal.css +++ b/src/css/modal.css @@ -43,13 +43,16 @@ .modal-body { border-radius: var(--theme-radius) var(--theme-radius) 0 0; - padding: 2em; overflow-y: auto; box-sizing: border-box; z-index: 1; position: relative; } +.modal-body-spacer { + margin: 2em; +} + .modal-heading:focus { outline: none; } diff --git a/src/js/modal.js b/src/js/modal.js index cc999025..d58f39ce 100644 --- a/src/js/modal.js +++ b/src/js/modal.js @@ -101,6 +101,7 @@ var modal = (function() { bind.focus.remove(); }; var modalBody = helper.node("div|class:modal-body"); + var modalBodySpacer = helper.node("div|class:modal-body-spacer"); var modalControls = helper.node("div|class:modal-controls form-group"); var actionButton = helper.node("button:" + options.actionText + "|class:button button-line button-block modal-button,tabindex:1"); var cancelButton = helper.node("button:" + options.cancelText + "|class:button button-line button-block modal-button,tabindex:1"); @@ -118,7 +119,7 @@ var modal = (function() { value: 1 }] }); - modalBody.appendChild(modalHeading); + modalBodySpacer.appendChild(modalHeading); }; if (options.content) { if (typeof options.content == "string") { @@ -128,11 +129,12 @@ var modal = (function() { text: options.content }); container.appendChild(para); - modalBody.appendChild(container); + modalBodySpacer.appendChild(container); } else { - modalBody.appendChild(options.content); + modalBodySpacer.appendChild(options.content); }; }; + modalBody.appendChild(modalBodySpacer); modalWrapper.appendChild(modalBody); modalWrapper.appendChild(modalControls); modal.appendChild(modalWrapper);