diff --git a/IPython/html/static/base/less/page.less b/IPython/html/static/base/less/page.less
index ddc7d98..56533dd 100644
--- a/IPython/html/static/base/less/page.less
+++ b/IPython/html/static/base/less/page.less
@@ -120,9 +120,11 @@ span#login_widget > .button,
// class for stretching dialogs to fill the screen
.modal_stretch .modal-dialog {
.vbox();
- min-height: 80%;
+ min-height: 80vh;
.modal-body {
- max-height: none;
+ // ~"foo" is to avoid less turning this into a weird value
+ max-height: calc(~"100vh - 200px");
+ overflow: auto;
flex: 1;
}
}
diff --git a/IPython/html/static/style/style.min.css b/IPython/html/static/style/style.min.css
index db72a44..c4608ca 100644
--- a/IPython/html/static/style/style.min.css
+++ b/IPython/html/static/style/style.min.css
@@ -8572,10 +8572,11 @@ span#login_widget > .button .badge,
display: flex;
flex-direction: column;
align-items: stretch;
- min-height: 80%;
+ min-height: 80vh;
}
.modal_stretch .modal-dialog .modal-body {
- max-height: none;
+ max-height: calc(100vh - 200px);
+ overflow: auto;
flex: 1;
}
@media (min-width: 768px) {