popovers.less 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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, .2));
  22. // Offset the popover to account for the popover arrow
  23. &.top { margin-top: -@popover-arrow-width; }
  24. &.right { margin-left: @popover-arrow-width; }
  25. &.bottom { margin-top: @popover-arrow-width; }
  26. &.left { margin-left: -@popover-arrow-width; }
  27. // Arrows
  28. // .arrow is outer, .arrow:after is inner
  29. > .arrow {
  30. border-width: @popover-arrow-outer-width;
  31. &,
  32. &:after {
  33. position: absolute;
  34. display: block;
  35. width: 0;
  36. height: 0;
  37. border-color: transparent;
  38. border-style: solid;
  39. }
  40. &:after {
  41. content: "";
  42. border-width: @popover-arrow-width;
  43. }
  44. }
  45. &.top > .arrow {
  46. bottom: -@popover-arrow-outer-width;
  47. left: 50%;
  48. margin-left: -@popover-arrow-outer-width;
  49. border-top-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  50. border-top-color: @popover-arrow-outer-color;
  51. border-bottom-width: 0;
  52. &:after {
  53. bottom: 1px;
  54. margin-left: -@popover-arrow-width;
  55. content: " ";
  56. border-top-color: @popover-arrow-color;
  57. border-bottom-width: 0;
  58. }
  59. }
  60. &.right > .arrow {
  61. top: 50%;
  62. left: -@popover-arrow-outer-width;
  63. margin-top: -@popover-arrow-outer-width;
  64. border-right-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  65. border-right-color: @popover-arrow-outer-color;
  66. border-left-width: 0;
  67. &:after {
  68. bottom: -@popover-arrow-width;
  69. left: 1px;
  70. content: " ";
  71. border-right-color: @popover-arrow-color;
  72. border-left-width: 0;
  73. }
  74. }
  75. &.bottom > .arrow {
  76. top: -@popover-arrow-outer-width;
  77. left: 50%;
  78. margin-left: -@popover-arrow-outer-width;
  79. border-top-width: 0;
  80. border-bottom-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  81. border-bottom-color: @popover-arrow-outer-color;
  82. &:after {
  83. top: 1px;
  84. margin-left: -@popover-arrow-width;
  85. content: " ";
  86. border-top-width: 0;
  87. border-bottom-color: @popover-arrow-color;
  88. }
  89. }
  90. &.left > .arrow {
  91. top: 50%;
  92. right: -@popover-arrow-outer-width;
  93. margin-top: -@popover-arrow-outer-width;
  94. border-right-width: 0;
  95. border-left-color: @popover-arrow-outer-fallback-color; // IE8 fallback
  96. border-left-color: @popover-arrow-outer-color;
  97. &:after {
  98. right: 1px;
  99. bottom: -@popover-arrow-width;
  100. content: " ";
  101. border-right-width: 0;
  102. border-left-color: @popover-arrow-color;
  103. }
  104. }
  105. }
  106. .popover-title {
  107. padding: 8px 14px;
  108. margin: 0; // reset heading margin
  109. font-size: @font-size-base;
  110. background-color: @popover-title-bg;
  111. border-bottom: 1px solid darken(@popover-title-bg, 5%);
  112. border-radius: (@border-radius-large - 1) (@border-radius-large - 1) 0 0;
  113. }
  114. .popover-content {
  115. padding: 9px 14px;
  116. }