modals.less 1.7 KB

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