popovers.less 3.4 KB

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