popovers.less 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. //
  2. // Popovers
  3. // --------------------------------------------------
  4. .popover {
  5. position: absolute;
  6. top: 0;
  7. left: 0;
  8. z-index: @zindexPopover;
  9. display: none;
  10. max-width: 276px;
  11. padding: 1px;
  12. text-align: left; // Reset given new insertion method
  13. background-color: @popoverBackground;
  14. -webkit-background-clip: padding-box;
  15. -moz-background-clip: padding;
  16. background-clip: padding-box;
  17. border: 1px solid #ccc;
  18. border: 1px solid rgba(0,0,0,.2);
  19. .border-radius(6px);
  20. .box-shadow(0 5px 10px rgba(0,0,0,.2));
  21. // Overrides for proper insertion
  22. white-space: normal;
  23. // Offset the popover to account for the popover arrow
  24. &.top { margin-top: -10px; }
  25. &.right { margin-left: 10px; }
  26. &.bottom { margin-top: 10px; }
  27. &.left { margin-left: -10px; }
  28. }
  29. .popover-title {
  30. margin: 0; // reset heading margin
  31. padding: 8px 14px;
  32. font-size: 14px;
  33. font-weight: normal;
  34. line-height: 18px;
  35. background-color: @popoverTitleBackground;
  36. border-bottom: 1px solid darken(@popoverTitleBackground, 5%);
  37. .border-radius(5px 5px 0 0);
  38. &:empty {
  39. display: none;
  40. }
  41. }
  42. .popover-content {
  43. padding: 9px 14px;
  44. }
  45. // Arrows
  46. //
  47. // .arrow is outer, .arrow:after is inner
  48. .popover .arrow,
  49. .popover .arrow:after {
  50. position: absolute;
  51. display: block;
  52. width: 0;
  53. height: 0;
  54. border-color: transparent;
  55. border-style: solid;
  56. }
  57. .popover .arrow {
  58. border-width: @popoverArrowOuterWidth;
  59. }
  60. .popover .arrow:after {
  61. border-width: @popoverArrowWidth;
  62. content: "";
  63. }
  64. .popover {
  65. &.top .arrow {
  66. left: 50%;
  67. margin-left: -@popoverArrowOuterWidth;
  68. border-bottom-width: 0;
  69. border-top-color: #999; // IE8 fallback
  70. border-top-color: @popoverArrowOuterColor;
  71. bottom: -@popoverArrowOuterWidth;
  72. &:after {
  73. bottom: 1px;
  74. margin-left: -@popoverArrowWidth;
  75. border-bottom-width: 0;
  76. border-top-color: @popoverArrowColor;
  77. }
  78. }
  79. &.right .arrow {
  80. top: 50%;
  81. left: -@popoverArrowOuterWidth;
  82. margin-top: -@popoverArrowOuterWidth;
  83. border-left-width: 0;
  84. border-right-color: #999; // IE8 fallback
  85. border-right-color: @popoverArrowOuterColor;
  86. &:after {
  87. left: 1px;
  88. bottom: -@popoverArrowWidth;
  89. border-left-width: 0;
  90. border-right-color: @popoverArrowColor;
  91. }
  92. }
  93. &.bottom .arrow {
  94. left: 50%;
  95. margin-left: -@popoverArrowOuterWidth;
  96. border-top-width: 0;
  97. border-bottom-color: #999; // IE8 fallback
  98. border-bottom-color: @popoverArrowOuterColor;
  99. top: -@popoverArrowOuterWidth;
  100. &:after {
  101. top: 1px;
  102. margin-left: -@popoverArrowWidth;
  103. border-top-width: 0;
  104. border-bottom-color: @popoverArrowColor;
  105. }
  106. }
  107. &.left .arrow {
  108. top: 50%;
  109. right: -@popoverArrowOuterWidth;
  110. margin-top: -@popoverArrowOuterWidth;
  111. border-right-width: 0;
  112. border-left-color: #999; // IE8 fallback
  113. border-left-color: @popoverArrowOuterColor;
  114. &:after {
  115. right: 1px;
  116. border-right-width: 0;
  117. border-left-color: @popoverArrowColor;
  118. bottom: -@popoverArrowWidth;
  119. }
  120. }
  121. }