1
0

modals.less 1.9 KB

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