Skip to content

Commit 84cdeb9

Browse files
committed
[design] improve modal body padding
1 parent f624d98 commit 84cdeb9

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

‎src/css/modal.css‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,16 @@
4343

4444
.modal-body{
4545
border-radius:var(--theme-radius) var(--theme-radius) 00;
46-
padding:2em;
4746
overflow-y: auto;
4847
box-sizing: border-box;
4948
z-index:1;
5049
position: relative;
5150
}
5251

52+
.modal-body-spacer{
53+
margin:2em;
54+
}
55+
5356
.modal-heading:focus{
5457
outline: none;
5558
}

‎src/js/modal.js‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ var modal = (function(){
101101
bind.focus.remove();
102102
};
103103
varmodalBody=helper.node("div|class:modal-body");
104+
varmodalBodySpacer=helper.node("div|class:modal-body-spacer");
104105
varmodalControls=helper.node("div|class:modal-controls form-group");
105106
varactionButton=helper.node("button:"+options.actionText+"|class:button button-line button-block modal-button,tabindex:1");
106107
varcancelButton=helper.node("button:"+options.cancelText+"|class:button button-line button-block modal-button,tabindex:1");
@@ -118,7 +119,7 @@ var modal = (function(){
118119
value: 1
119120
}]
120121
});
121-
modalBody.appendChild(modalHeading);
122+
modalBodySpacer.appendChild(modalHeading);
122123
};
123124
if(options.content){
124125
if(typeofoptions.content=="string"){
@@ -128,11 +129,12 @@ var modal = (function(){
128129
text: options.content
129130
});
130131
container.appendChild(para);
131-
modalBody.appendChild(container);
132+
modalBodySpacer.appendChild(container);
132133
}else{
133-
modalBody.appendChild(options.content);
134+
modalBodySpacer.appendChild(options.content);
134135
};
135136
};
137+
modalBody.appendChild(modalBodySpacer);
136138
modalWrapper.appendChild(modalBody);
137139
modalWrapper.appendChild(modalControls);
138140
modal.appendChild(modalWrapper);

0 commit comments

Comments
(0)