_popovers.scss 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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: 480px;
  11. padding: 1px;
  12. text-align: left; // Reset given new insertion method
  13. background-color: $popoverBackground;
  14. background-clip: padding-box;
  15. border: 1px solid #ccc;
  16. border: 1px solid rgba(0,0,0,.2);
  17. @include box-shadow(0 5px 10px rgba(0,0,0,.2));
  18. // Overrides for proper insertion
  19. white-space: normal;
  20. // Offset the popover to account for the popover arrow
  21. &.top { margin-top: -10px; }
  22. &.right { margin-left: 10px; }
  23. &.bottom { margin-top: 10px; }
  24. &.left { margin-left: -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. &:empty {
  34. display: none;
  35. }
  36. }
  37. .popover-content {
  38. padding: 9px 14px;
  39. }
  40. // Arrows
  41. //
  42. // .arrow is outer, .arrow:after is inner
  43. .popover .arrow,
  44. .popover .arrow:after {
  45. position: absolute;
  46. display: block;
  47. width: 0;
  48. height: 0;
  49. border-color: transparent;
  50. border-style: solid;
  51. }
  52. .popover .arrow {
  53. border-width: $popoverArrowOuterWidth;
  54. }
  55. .popover .arrow:after {
  56. border-width: $popoverArrowWidth;
  57. content: "";
  58. }
  59. .popover {
  60. &.top .arrow {
  61. left: 50%;
  62. margin-left: -$popoverArrowOuterWidth;
  63. border-bottom-width: 0;
  64. border-top-color: #999; // IE8 fallback
  65. border-top-color: $popoverArrowOuterColor;
  66. bottom: -$popoverArrowOuterWidth;
  67. &:after {
  68. bottom: 1px;
  69. margin-left: -$popoverArrowWidth;
  70. border-bottom-width: 0;
  71. border-top-color: $popoverArrowColor;
  72. }
  73. }
  74. &.right .arrow {
  75. top: 50%;
  76. left: -$popoverArrowOuterWidth;
  77. margin-top: -$popoverArrowOuterWidth;
  78. border-left-width: 0;
  79. border-right-color: #999; // IE8 fallback
  80. border-right-color: $popoverArrowOuterColor;
  81. &:after {
  82. left: 1px;
  83. bottom: -$popoverArrowWidth;
  84. border-left-width: 0;
  85. border-right-color: $popoverArrowColor;
  86. }
  87. }
  88. &.bottom .arrow {
  89. left: 50%;
  90. margin-left: -$popoverArrowOuterWidth;
  91. border-top-width: 0;
  92. border-bottom-color: #999; // IE8 fallback
  93. border-bottom-color: $popoverArrowOuterColor;
  94. top: -$popoverArrowOuterWidth;
  95. &:after {
  96. top: 1px;
  97. margin-left: -$popoverArrowWidth;
  98. border-top-width: 0;
  99. border-bottom-color: $popoverArrowColor;
  100. }
  101. }
  102. &.left .arrow {
  103. top: 50%;
  104. right: -$popoverArrowOuterWidth;
  105. margin-top: -$popoverArrowOuterWidth;
  106. border-right-width: 0;
  107. border-left-color: #999; // IE8 fallback
  108. border-left-color: $popoverArrowOuterColor;
  109. &:after {
  110. right: 1px;
  111. border-right-width: 0;
  112. border-left-color: $popoverArrowColor;
  113. bottom: -$popoverArrowWidth;
  114. }
  115. }
  116. }