_popovers.scss 3.4 KB

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