tooltip.scss 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /**
  2. * @copyright Copyright (c) 2016, John Molakvoæ <skjnldsv@protonmail.com>
  3. * @copyright Copyright (c) 2016, Robin Appelman <robin@icewind.nl>
  4. * @copyright Copyright (c) 2016, Jan-Christoph Borchardt <hey@jancborchardt.net>
  5. * @copyright Copyright (c) 2016, Erik Pellikka <erik@pellikka.org>
  6. * @copyright Copyright (c) 2015, Vincent Petry <pvince81@owncloud.com>
  7. *
  8. * Bootstrap v3.3.5 (http://getbootstrap.com)
  9. * Copyright 2011-2015 Twitter, Inc.
  10. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  11. */
  12. .tooltip {
  13. position: absolute;
  14. display: block;
  15. font-family: var(--font-face);
  16. font-style: normal;
  17. font-weight: normal;
  18. letter-spacing: normal;
  19. line-break: auto;
  20. line-height: 1.6;
  21. text-align: left;
  22. text-align: start;
  23. text-decoration: none;
  24. text-shadow: none;
  25. text-transform: none;
  26. white-space: normal;
  27. word-break: normal;
  28. word-spacing: normal;
  29. word-wrap: normal;
  30. font-size: 12px;
  31. opacity: 0;
  32. z-index: 100000;
  33. /* default to top */
  34. margin-top: -3px;
  35. padding: 10px 0;
  36. filter: drop-shadow(0 1px 10px var(--color-box-shadow));
  37. &.in,
  38. &.show,
  39. &.tooltip[aria-hidden='false'] {
  40. visibility: visible;
  41. opacity: 1;
  42. transition: opacity .15s;
  43. }
  44. &.top .tooltip-arrow,
  45. &[x-placement^='top'] {
  46. left: 50%;
  47. margin-left: -10px;
  48. }
  49. &.bottom,
  50. &[x-placement^='bottom'] {
  51. margin-top: 3px;
  52. padding: 10px 0;
  53. }
  54. &.right,
  55. &[x-placement^='right'] {
  56. margin-left: 3px;
  57. padding: 0 10px;
  58. .tooltip-arrow {
  59. top: 50%;
  60. left: 0;
  61. margin-top: -10px;
  62. border-width: 10px 10px 10px 0;
  63. border-right-color: var(--color-main-background);
  64. }
  65. }
  66. &.left,
  67. &[x-placement^='left'] {
  68. margin-left: -3px;
  69. padding: 0 5px;
  70. .tooltip-arrow {
  71. top: 50%;
  72. right: 0;
  73. margin-top: -10px;
  74. border-width: 10px 0 10px 10px;
  75. border-left-color: var(--color-main-background);
  76. }
  77. }
  78. /* TOP */
  79. &.top,
  80. &.top-left,
  81. &[x-placement^='top'],
  82. &.top-right {
  83. .tooltip-arrow, .arrow {
  84. bottom: 0;
  85. border-width: 10px 10px 0;
  86. border-top-color: var(--color-main-background);
  87. }
  88. }
  89. &.top-left .tooltip-arrow {
  90. right: 10px;
  91. margin-bottom: -10px;
  92. }
  93. &.top-right .tooltip-arrow {
  94. left: 10px;
  95. margin-bottom: -10px;
  96. }
  97. /* BOTTOM */
  98. &.bottom,
  99. &[x-placement^='bottom'],
  100. &.bottom-left,
  101. &.bottom-right {
  102. .tooltip-arrow, .arrow {
  103. top: 0;
  104. border-width: 0 10px 10px;
  105. border-bottom-color: var(--color-main-background);
  106. }
  107. }
  108. &[x-placement^='bottom'] .tooltip-arrow,
  109. &.bottom .tooltip-arrow {
  110. left: 50%;
  111. margin-left: -10px;
  112. }
  113. &.bottom-left .tooltip-arrow {
  114. right: 10px;
  115. margin-top: -10px;
  116. }
  117. &.bottom-right .tooltip-arrow {
  118. left: 10px;
  119. margin-top: -10px;
  120. }
  121. }
  122. .tooltip-inner {
  123. max-width: 350px;
  124. padding: 5px 8px;
  125. background-color: var(--color-main-background);
  126. color: var(--color-main-text);
  127. text-align: center;
  128. border-radius: var(--border-radius);
  129. }
  130. .tooltip-arrow, .tooltip .arrow {
  131. position: absolute;
  132. width: 0;
  133. height: 0;
  134. border-color: transparent;
  135. border-style: solid;
  136. }