diff --git a/package-lock.json b/package-lock.json
index 6ce1536d2..625c70f3a 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "@dabapps/roe",
- "version": "0.9.8",
+ "version": "0.9.9",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index e19e88ed9..8edb0bcc5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@dabapps/roe",
- "version": "0.9.8",
+ "version": "0.9.9",
"description": "A Collection of React Components for Project Development",
"main": "dist/js/index.js",
"types": "dist/js/index.d.ts",
diff --git a/src/less/modals.less b/src/less/modals.less
index 73ee8bea2..e55111b78 100644
--- a/src/less/modals.less
+++ b/src/less/modals.less
@@ -69,17 +69,20 @@
}
.modal-position {
- padding: 0 @gutter-width / 2;
+ padding: @modal-margin-vertical @modal-margin-horizontal;
margin: 0 auto;
- @modal-margins: @margin-large * 2;
- @modal-header-and-footer-margins: (@margin-large * 2) * 2;
- @modal-header-and-footer-content: 50px * 2; // Magic number to allow slightly larger content
- @modal-header-and-footer-space: @modal-margins + @modal-header-and-footer-margins + @modal-header-and-footer-content;
+ // For internal use only
+ @modal-margin-vertical-double: @modal-margin-vertical * 2;
&.scrollable {
+ .modal {
+ display: flex;
+ flex-direction: column;
+ max-height: ~'calc(100vh - @{modal-margin-vertical-double})';
+ }
+
.modal-body {
- max-height: ~'calc(100vh - @{modal-header-and-footer-space})';
overflow: auto;
}
}
@@ -115,6 +118,7 @@
.modal {
.content-box();
+ margin: 0;
position: relative;
z-index: 1;
transform: translate3d(0, 0, 0);
diff --git a/src/less/variables.less b/src/less/variables.less
index e0525d282..fa4821bd8 100644
--- a/src/less/variables.less
+++ b/src/less/variables.less
@@ -122,6 +122,9 @@
@modal-footer-background: @modal-header-background;
@modal-footer-border: @modal-header-border;
+@modal-margin-vertical: @gutter-width / 2;
+@modal-margin-horizontal: @gutter-width / 2;
+
@well-background: @grey-lightest;
@well-border: @border-base;
diff --git a/src/ts/components/modals/modal.examples.md b/src/ts/components/modals/modal.examples.md
index f71cfc512..c8dfc71c4 100644
--- a/src/ts/components/modals/modal.examples.md
+++ b/src/ts/components/modals/modal.examples.md
@@ -16,6 +16,8 @@ class ModalExample extends React.Component {
};
this.onClickOpenModal = this.onClickOpenModal.bind(this);
+ this.onClickOpenScrollableModal = this.onClickOpenScrollableModal.bind(this);
+ this.onClickOpenSmallModal = this.onClickOpenSmallModal.bind(this);
this.onClickCloseModal = this.onClickCloseModal.bind(this);
}
@@ -56,15 +58,85 @@ class ModalExample extends React.Component {
});
}
+ onClickOpenScrollableModal () {
+ this.setState({
+ modals: [
+
+ Header
+
+
+ Header
+
+