]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Updat modal sizing 19105/head
authorMark Otto <markdotto@gmail.com>
Sun, 7 Feb 2016 04:18:48 +0000 (20:18 -0800)
committerMark Otto <markdotto@gmail.com>
Sun, 7 Feb 2016 04:18:48 +0000 (20:18 -0800)
- Switch from width to max-width for all widths to avoid scaling outside viewport bounds
- Rejigger the media queries for a more logical breakpoint for the large and small modal sizes
- Avoids changing the width of the default modal (nullifying #17794 and fixing #17581)

docs/components/modal.md
scss/_modal.scss

index e8627fe682e15d944499c2c9ad011f21689b69b4..a8b1b485063d6e78cadcdcf8cea874ebd55c8712 100644 (file)
@@ -181,7 +181,7 @@ Embedding YouTube videos in modals requires additional JavaScript not in Bootstr
 
 ## Optional sizes
 
-Modals have two optional sizes, available via modifier classes to be placed on a `.modal-dialog`.
+Modals have two optional sizes, available via modifier classes to be placed on a `.modal-dialog`. These size kick in at certain breakpoints to avoid horizontal scrollbars on narrower viewports.
 
 <div class="bd-example">
   <button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-lg">Large modal</button>
index c43d55b5ac58e090dc122c891155a6b9d3ce91b6..83bb4932be2dff4a9a61bd781871407ee741725d 100644 (file)
 @include media-breakpoint-up(sm) {
   // Automatically set modal's width for larger viewports
   .modal-dialog {
-    width: $modal-md;
+    max-width: $modal-md;
     margin: 30px auto;
   }
+
   .modal-content {
     @include box-shadow($modal-content-sm-up-box-shadow);
   }
 
-  // Modal sizes
-  .modal-sm { width: $modal-sm; }
+  .modal-sm { max-width: $modal-sm; }
 }
 
-@include media-breakpoint-up(md) {
-  .modal-lg { width: $modal-lg; }
+@include media-breakpoint-up(lg) {
+  .modal-lg { max-width: $modal-lg; }
 }