popovers.less 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. //
  2. // Popovers
  3. // --------------------------------------------------
  4. .popover {
  5. position: absolute;
  6. top: 0;
  7. left: 0;
  8. z-index: @zindex-popover;
  9. display: none;
  10. max-width: @popover-max-width;
  11. padding: 1px;
  12. text-align: left; // Reset given new insertion method
  13. background-color: @popover-bg;
  14. background-clip: padding-box;
  15. border: 1px solid @popover-fallback-border-color;
  16. border: 1px solid @popover-border-color;
  17. border-radius: @border-radius-large;
  18. .box-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
  19. // Overrides for proper insertion
  20. white-space: normal;
  21. // Offset the popover to account for the popover arrow
  22. &.top {
  23. margin-top: -@popover-arrow-width;
  24. }
  25. &.right {
  26. margin-left: @popover-arrow-width;
  27. }
  28. &.bottom {
  29. margin-top: @popover-arrow-width;
  30. }
  31. &.left {
  32. margin-left: -@popover-arrow-width;
  33. }
  34. }
  35. .popover-title {
  36. margin: 0; // reset heading margin
  37. padding: 8px 14px;
  38. font-size: @font-size-base;
  39. font-weight: normal;
  40. line-height: 18px;
  41. background-color: @popover-title-bg;
  42. border-bottom: 1px solid darken(@popover-title-bg, 5%);
  43. border-radius: 5px 5px 0 0;
  44. }
  45. .popover-content {
  46. padding: 9px 14px;
  47. }
  48. // Arrows
  49. //
  50. // .arrow is outer, .arrow:after is inner
  51. .popover > .arrow {
  52. &,
  53. &:after {
  54. position: absolute;
  55. display: block;
  56. width: 0;
  57. height: 0;
  58. border-color: transparent;
  59. border-style: solid;
  60. }
  61. }
  62. .popover > .arrow {
  63. border-width: @popover-arrow-outer-width;
  64. }
  65. .popover > .arrow:after {
  66. border-width: @popover-arrow-width;
  67. content: '';
  68. }
  69. .popover {
  70. &.top > .arrow {
  71. left: 50%;
  72. margin-left: -@popover-arrow-outer-width;
  73. border-bottom-width: 0;
  74. border-top-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  75. border-top-color: @popover-arrow-outer-color;
  76. bottom: -@popover-arrow-outer-width;
  77. &:after {
  78. content: ' ';
  79. bottom: 1px;
  80. margin-left: -@popover-arrow-width;
  81. border-bottom-width: 0;
  82. border-top-color: @popover-arrow-color;
  83. }
  84. }
  85. &.right > .arrow {
  86. top: 50%;
  87. left: -@popover-arrow-outer-width;
  88. margin-top: -@popover-arrow-outer-width;
  89. border-left-width: 0;
  90. border-right-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  91. border-right-color: @popover-arrow-outer-color;
  92. &:after {
  93. content: ' ';
  94. left: 1px;
  95. bottom: -@popover-arrow-width;
  96. border-left-width: 0;
  97. border-right-color: @popover-arrow-color;
  98. }
  99. }
  100. &.bottom > .arrow {
  101. left: 50%;
  102. margin-left: -@popover-arrow-outer-width;
  103. border-top-width: 0;
  104. border-bottom-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  105. border-bottom-color: @popover-arrow-outer-color;
  106. top: -@popover-arrow-outer-width;
  107. &:after {
  108. content: ' ';
  109. top: 1px;
  110. margin-left: -@popover-arrow-width;
  111. border-top-width: 0;
  112. border-bottom-color: @popover-arrow-color;
  113. }
  114. }
  115. &.left > .arrow {
  116. top: 50%;
  117. right: -@popover-arrow-outer-width;
  118. margin-top: -@popover-arrow-outer-width;
  119. border-right-width: 0;
  120. border-left-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  121. border-left-color: @popover-arrow-outer-color;
  122. &:after {
  123. content: ' ';
  124. right: 1px;
  125. border-right-width: 0;
  126. border-left-color: @popover-arrow-color;
  127. bottom: -@popover-arrow-width;
  128. }
  129. }
  130. }
  131. .popover.dark-themed {
  132. .popover-title {
  133. color: @popover-dark-color;
  134. background-color: @popover-dark-bg;
  135. border-bottom: 0;
  136. font-family: Lato, sans-serif;
  137. font-weight: bold;
  138. }
  139. .popover-content {
  140. color: @popover-dark-color;
  141. background-color: @popover-dark-bg;
  142. }
  143. a {
  144. color: #97b6e5;
  145. }
  146. padding: 0;
  147. border: 1px solid @popover-dark-border-color;
  148. max-width: @popover-dark-max-width;
  149. }
  150. .popover.dark-themed {
  151. &.top > .arrow {
  152. border-top-color: @popover-dark-arrow-outer-color;
  153. &:after {
  154. border-top-color: @popover-dark-arrow-color;
  155. }
  156. }
  157. &.right > .arrow {
  158. border-right-color: @popover-dark-arrow-outer-color;
  159. &:after {
  160. border-right-color: @popover-dark-arrow-color;
  161. }
  162. }
  163. &.bottom > .arrow {
  164. border-bottom-color: @popover-dark-arrow-outer-color;
  165. &:after {
  166. border-bottom-color: @popover-dark-arrow-color;
  167. }
  168. }
  169. &.left > .arrow {
  170. border-left-color: @popover-dark-arrow-outer-color;
  171. &:after {
  172. border-left-color: @popover-dark-arrow-color;
  173. }
  174. }
  175. }