modals.less 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. max-height: 500px;
  33. overflow: auto;
  34. width: 560px;
  35. margin: -250px 0 0 -280px;
  36. background-color: @white;
  37. border: 1px solid #999;
  38. border: 1px solid rgba(0,0,0,.3);
  39. *border: 1px solid #999; /* IE6-7 */
  40. .border-radius(6px);
  41. .box-shadow(0 3px 7px rgba(0,0,0,0.3));
  42. .background-clip(padding-box);
  43. &.fade {
  44. .transition(e('opacity .3s linear, top .3s ease-out'));
  45. top: -25%;
  46. }
  47. &.fade.in { top: 50%; }
  48. }
  49. .modal-header {
  50. padding: 9px 15px;
  51. border-bottom: 1px solid #eee;
  52. // Close icon
  53. .close { margin-top: 2px; }
  54. }
  55. // Body (where all modal content resises)
  56. .modal-body {
  57. padding: 15px;
  58. }
  59. // Remove bottom margin if need be
  60. .modal-body .modal-form {
  61. margin-bottom: 0;
  62. }
  63. // Footer (for actions)
  64. .modal-footer {
  65. padding: 14px 15px 15px;
  66. margin-bottom: 0;
  67. background-color: #f5f5f5;
  68. border-top: 1px solid #ddd;
  69. .border-radius(0 0 6px 6px);
  70. .box-shadow(inset 0 1px 0 @white);
  71. .clearfix();
  72. .btn {
  73. float: right;
  74. margin-left: 5px;
  75. margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs
  76. }
  77. }