You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: docs/4.0/components/modal.md
+58
Original file line number
Diff line number
Diff line change
@@ -208,6 +208,64 @@ When modals become too long for the user's viewport or device, they scroll indep
208
208
</div>
209
209
{% endhighlight %}
210
210
211
+
### Vertically centered
212
+
213
+
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.
<p>Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
[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.
0 commit comments