You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.9 KiB

10 years ago
10 years ago
10 years ago
10 years ago
  1. //
  2. // Tooltips
  3. // --------------------------------------------------
  4. // Base class
  5. .tooltip {
  6. position: absolute;
  7. z-index: @zindex-tooltip;
  8. display: block;
  9. // Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element.
  10. // So reset our font and text properties to avoid inheriting weird values.
  11. .reset-text();
  12. font-size: @font-size-small;
  13. .opacity(0);
  14. &.in { .opacity(@tooltip-opacity); }
  15. &.top {
  16. padding: @tooltip-arrow-width 0;
  17. margin-top: -3px;
  18. }
  19. &.right {
  20. padding: 0 @tooltip-arrow-width;
  21. margin-left: 3px;
  22. }
  23. &.bottom {
  24. padding: @tooltip-arrow-width 0;
  25. margin-top: 3px;
  26. }
  27. &.left {
  28. padding: 0 @tooltip-arrow-width;
  29. margin-left: -3px;
  30. }
  31. // Note: Deprecated .top-left, .top-right, .bottom-left, and .bottom-right as of v3.3.1
  32. &.top .tooltip-arrow {
  33. bottom: 0;
  34. left: 50%;
  35. margin-left: -@tooltip-arrow-width;
  36. border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
  37. border-top-color: @tooltip-arrow-color;
  38. }
  39. &.top-left .tooltip-arrow {
  40. right: @tooltip-arrow-width;
  41. bottom: 0;
  42. margin-bottom: -@tooltip-arrow-width;
  43. border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
  44. border-top-color: @tooltip-arrow-color;
  45. }
  46. &.top-right .tooltip-arrow {
  47. bottom: 0;
  48. left: @tooltip-arrow-width;
  49. margin-bottom: -@tooltip-arrow-width;
  50. border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
  51. border-top-color: @tooltip-arrow-color;
  52. }
  53. &.right .tooltip-arrow {
  54. top: 50%;
  55. left: 0;
  56. margin-top: -@tooltip-arrow-width;
  57. border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0;
  58. border-right-color: @tooltip-arrow-color;
  59. }
  60. &.left .tooltip-arrow {
  61. top: 50%;
  62. right: 0;
  63. margin-top: -@tooltip-arrow-width;
  64. border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width;
  65. border-left-color: @tooltip-arrow-color;
  66. }
  67. &.bottom .tooltip-arrow {
  68. top: 0;
  69. left: 50%;
  70. margin-left: -@tooltip-arrow-width;
  71. border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
  72. border-bottom-color: @tooltip-arrow-color;
  73. }
  74. &.bottom-left .tooltip-arrow {
  75. top: 0;
  76. right: @tooltip-arrow-width;
  77. margin-top: -@tooltip-arrow-width;
  78. border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
  79. border-bottom-color: @tooltip-arrow-color;
  80. }
  81. &.bottom-right .tooltip-arrow {
  82. top: 0;
  83. left: @tooltip-arrow-width;
  84. margin-top: -@tooltip-arrow-width;
  85. border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
  86. border-bottom-color: @tooltip-arrow-color;
  87. }
  88. }
  89. // Wrapper for the tooltip content
  90. .tooltip-inner {
  91. max-width: @tooltip-max-width;
  92. padding: 3px 8px;
  93. color: @tooltip-color;
  94. text-align: center;
  95. background-color: @tooltip-bg;
  96. border-radius: @border-radius-base;
  97. }
  98. // Arrows
  99. .tooltip-arrow {
  100. position: absolute;
  101. width: 0;
  102. height: 0;
  103. border-color: transparent;
  104. border-style: solid;
  105. }