popovers.less 2.9 KB

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