modals.less 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // Modals
  3. // --------------------------------------------------
  4. // Recalculate z-index where appropriate,
  5. // but only apply to elements within modal
  6. .modal-open .modal {
  7. .dropdown-menu { z-index: @zindexDropdown + @zindexModal; }
  8. .dropdown.open { *z-index: @zindexDropdown + @zindexModal; }
  9. .popover { z-index: @zindexPopover + @zindexModal; }
  10. .tooltip { z-index: @zindexTooltip + @zindexModal; }
  11. }
  12. // Background
  13. .modal-backdrop {
  14. position: fixed;
  15. top: 0;
  16. right: 0;
  17. bottom: 0;
  18. left: 0;
  19. z-index: @zindexModalBackdrop;
  20. background-color: @black;
  21. // Fade for backdrop
  22. &.fade { opacity: 0; }
  23. }
  24. .modal-backdrop,
  25. .modal-backdrop.fade.in {
  26. .opacity(80);
  27. }
  28. // Base modal
  29. .modal {
  30. position: fixed;
  31. top: 50%;
  32. left: 50%;
  33. z-index: @zindexModal;
  34. overflow: auto;
  35. width: 560px;
  36. margin: -250px 0 0 -280px;
  37. background-color: @white;
  38. border: 1px solid #999;
  39. border: 1px solid rgba(0,0,0,.3);
  40. *border: 1px solid #999; /* IE6-7 */
  41. .border-radius(6px);
  42. .box-shadow(0 3px 7px rgba(0,0,0,0.3));
  43. .background-clip(padding-box);
  44. &.fade {
  45. .transition(e('opacity .3s linear, top .3s ease-out'));
  46. top: -25%;
  47. }
  48. &.fade.in { top: 50%; }
  49. }
  50. .modal-header {
  51. padding: 9px 15px;
  52. border-bottom: 1px solid #eee;
  53. // Close icon
  54. .close { margin-top: 2px; }
  55. // Heading
  56. h3 {
  57. margin: 0;
  58. line-height: 30px;
  59. }
  60. }
  61. // Body (where all modal content resides)
  62. .modal-body {
  63. overflow-y: auto;
  64. max-height: 400px;
  65. padding: 15px;
  66. }
  67. // Remove bottom margin if need be
  68. .modal-form {
  69. margin-bottom: 0;
  70. }
  71. // Footer (for actions)
  72. .modal-footer {
  73. padding: 14px 15px 15px;
  74. margin-bottom: 0;
  75. text-align: right; // right align buttons
  76. background-color: #f5f5f5;
  77. border-top: 1px solid #ddd;
  78. .border-radius(0 0 6px 6px);
  79. .box-shadow(inset 0 1px 0 @white);
  80. .clearfix(); // clear it in case folks use .pull-* classes on buttons
  81. // Properly space out buttons
  82. .btn + .btn {
  83. margin-left: 5px;
  84. margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs
  85. }
  86. // but override that for button groups
  87. .btn-group .btn + .btn {
  88. margin-left: -1px;
  89. }
  90. }