From b1623c44290b414b656bb4d9e3baaaa3093bda8f Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 29 Oct 2017 15:14:10 -0700 Subject: Add `.modal-dialog-centered` for optional vertically centered modal (#24510) * Add .modal-dialog-centered for optional vertically cenetered modal Fixes #23638 * adds modal-dialog-centered class to docs and removes margin to avoid generating a vertical scrolling * mention limitations * fix aria attr * Add `width: 100%` to the .modal-content for the centered version. Adding it here to avoid adding another selector by limiting it to the centered modal modifier. --- docs/4.0/components/modal.md | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'docs/4.0') diff --git a/docs/4.0/components/modal.md b/docs/4.0/components/modal.md index c4191b83d..b9ebc4ad4 100644 --- a/docs/4.0/components/modal.md +++ b/docs/4.0/components/modal.md @@ -208,6 +208,64 @@ When modals become too long for the user's viewport or device, they scroll indep {% endhighlight %} +### Vertically centered + +Add `.modal-dialog-centered` to `.modal-dialog` to vertically center the modal. **Do not use this with long modals**—it will overflow the viewport and potentially hide parts of your modal. + + + +
+ +
+ +{% highlight html %} + + + + + +{% endhighlight %} + ### Tooltips and popovers [Tooltips]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/tooltips/) and [popovers]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/popovers/) can be placed within modals as needed. When modals are closed, any tooltips and popovers within are also automatically dismissed. -- cgit v1.2.3