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