modals.less 2.0 KB

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