From dc9f1a1976e901f38904511e74883d2f7fc29694 Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Tue, 31 Jul 2018 21:12:39 +0200 Subject: [PATCH 1/4] Tweak modal transform --- scss/_modal.scss | 2 +- scss/_variables.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scss/_modal.scss b/scss/_modal.scss index 5eadbf5b84ba..75a954d23716 100644 --- a/scss/_modal.scss +++ b/scss/_modal.scss @@ -43,7 +43,7 @@ // When fading in the modal, animate it to slide down .modal.fade & { @include transition($modal-transition); - transform: translate(0, -25%); + transform: $modal-fade-transform; } .modal.show & { transform: translate(0, 0); diff --git a/scss/_variables.scss b/scss/_variables.scss index 8ac3bc583a4a..519055aa03d2 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -831,6 +831,7 @@ $modal-lg: 800px !default; $modal-md: 500px !default; $modal-sm: 300px !default; +$modal-fade-transform: translate(0, -50px) !default; $modal-transition: transform .3s ease-out !default; From 58d3611ee804c9c0b13d19bfd8da60a7ebc78878 Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Wed, 8 Aug 2018 16:08:25 +0200 Subject: [PATCH 2/4] Add $modal-show-transform option --- scss/_modal.scss | 2 +- scss/_variables.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scss/_modal.scss b/scss/_modal.scss index 75a954d23716..df8da68ffa5c 100644 --- a/scss/_modal.scss +++ b/scss/_modal.scss @@ -46,7 +46,7 @@ transform: $modal-fade-transform; } .modal.show & { - transform: translate(0, 0); + transform: $modal-show-transform; } } diff --git a/scss/_variables.scss b/scss/_variables.scss index 519055aa03d2..be13b5647642 100644 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@ -832,6 +832,7 @@ $modal-md: 500px !default; $modal-sm: 300px !default; $modal-fade-transform: translate(0, -50px) !default; +$modal-show-transform: none !default; $modal-transition: transform .3s ease-out !default; From 265b2f085fd39aeef5221bd95ebc165c8b3cac95 Mon Sep 17 00:00:00 2001 From: Martijn Cuppens Date: Wed, 8 Aug 2018 18:04:06 +0200 Subject: [PATCH 3/4] Modal dialog animation docs --- site/docs/4.1/components/modal.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/site/docs/4.1/components/modal.md b/site/docs/4.1/components/modal.md index ac9bf18e7c0d..1846a771ad86 100644 --- a/site/docs/4.1/components/modal.md +++ b/site/docs/4.1/components/modal.md @@ -448,6 +448,11 @@ $('#exampleModal').on('show.bs.modal', function (event) { }) {% endhighlight %} +### Change animation +The `$modal-fade-transform` variable determines the transform state of `.modal-dialog` before the modal fade-in animation, the `$modal-show-transform` variable determines the transform of `.modal-dialog` at the end of the modal fade-in animation. + +If you want for example a zoom-in animation, you can set `$modal-fade-transform: scale(.8)`. + ### Remove animation For modals that simply appear rather than fade in to view, remove the `.fade` class from your modal markup. From 671770949fa4c1392647ee2a9b62cd797163a819 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 13 Aug 2018 09:53:40 +0300 Subject: [PATCH 4/4] Update modal.md --- site/docs/4.1/components/modal.md | 1 + 1 file changed, 1 insertion(+) diff --git a/site/docs/4.1/components/modal.md b/site/docs/4.1/components/modal.md index 1846a771ad86..2da7d8f3c3d3 100644 --- a/site/docs/4.1/components/modal.md +++ b/site/docs/4.1/components/modal.md @@ -449,6 +449,7 @@ $('#exampleModal').on('show.bs.modal', function (event) { {% endhighlight %} ### Change animation + The `$modal-fade-transform` variable determines the transform state of `.modal-dialog` before the modal fade-in animation, the `$modal-show-transform` variable determines the transform of `.modal-dialog` at the end of the modal fade-in animation. If you want for example a zoom-in animation, you can set `$modal-fade-transform: scale(.8)`.