popovers.less 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. // Our parent element can be arbitrary since popovers are by default inserted as a sibling of their target element.
  13. // So reset our font and text properties to avoid inheriting weird values.
  14. .reset-text();
  15. font-size: @font-size-base;
  16. background-color: @popover-bg;
  17. background-clip: padding-box;
  18. border: 1px solid @popover-fallback-border-color;
  19. border: 1px solid @popover-border-color;
  20. border-radius: @border-radius-large;
  21. box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
  22. // Offset the popover to account for the popover arrow
  23. &.top {
  24. margin-top: -@popover-arrow-width;
  25. }
  26. &.right {
  27. margin-left: @popover-arrow-width;
  28. }
  29. &.bottom {
  30. margin-top: @popover-arrow-width;
  31. }
  32. &.left {
  33. margin-left: -@popover-arrow-width;
  34. }
  35. // Arrows
  36. // .arrow is outer, .arrow:after is inner
  37. > .arrow {
  38. border-width: @popover-arrow-outer-width;
  39. &,
  40. &:after {
  41. position: absolute;
  42. display: block;
  43. width: 0;
  44. height: 0;
  45. border-color: transparent;
  46. border-style: solid;
  47. }
  48. &:after {
  49. content: '';
  50. border-width: @popover-arrow-width;
  51. }
  52. }
  53. &.top > .arrow {
  54. bottom: -@popover-arrow-outer-width;
  55. left: 50%;
  56. margin-left: -@popover-arrow-outer-width;
  57. border-top-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  58. border-top-color: @popover-arrow-outer-color;
  59. border-bottom-width: 0;
  60. &:after {
  61. bottom: 1px;
  62. margin-left: -@popover-arrow-width;
  63. content: ' ';
  64. border-top-color: @popover-arrow-color;
  65. border-bottom-width: 0;
  66. }
  67. }
  68. &.right > .arrow {
  69. top: 50%;
  70. left: -@popover-arrow-outer-width;
  71. margin-top: -@popover-arrow-outer-width;
  72. border-right-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  73. border-right-color: @popover-arrow-outer-color;
  74. border-left-width: 0;
  75. &:after {
  76. bottom: -@popover-arrow-width;
  77. left: 1px;
  78. content: ' ';
  79. border-right-color: @popover-arrow-color;
  80. border-left-width: 0;
  81. }
  82. }
  83. &.bottom > .arrow {
  84. top: -@popover-arrow-outer-width;
  85. left: 50%;
  86. margin-left: -@popover-arrow-outer-width;
  87. border-top-width: 0;
  88. border-bottom-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  89. border-bottom-color: @popover-arrow-outer-color;
  90. &:after {
  91. top: 1px;
  92. margin-left: -@popover-arrow-width;
  93. content: ' ';
  94. border-top-width: 0;
  95. border-bottom-color: @popover-arrow-color;
  96. }
  97. }
  98. &.left > .arrow {
  99. top: 50%;
  100. right: -@popover-arrow-outer-width;
  101. margin-top: -@popover-arrow-outer-width;
  102. border-right-width: 0;
  103. border-left-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  104. border-left-color: @popover-arrow-outer-color;
  105. &:after {
  106. right: 1px;
  107. bottom: -@popover-arrow-width;
  108. content: ' ';
  109. border-right-width: 0;
  110. border-left-color: @popover-arrow-color;
  111. }
  112. }
  113. }
  114. .popover-title {
  115. padding: 8px 14px;
  116. margin: 0; // reset heading margin
  117. font-size: @font-size-base;
  118. background-color: @popover-title-bg;
  119. border-bottom: 1px solid darken(@popover-title-bg, 5%);
  120. border-radius: (@border-radius-large - 1) (@border-radius-large - 1) 0 0;
  121. }
  122. .popover-content {
  123. padding: 9px 14px;
  124. }