tooltip.scss 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*!
  2. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-FileCopyrightText: 2011-2015 Twitter, Inc. (Bootstrap (http://getbootstrap.com))
  4. * SPDX-License-Identifier: MIT
  5. */
  6. .tooltip {
  7. position: absolute;
  8. display: block;
  9. font-family: var(--font-face);
  10. font-style: normal;
  11. font-weight: normal;
  12. letter-spacing: normal;
  13. line-break: auto;
  14. line-height: 1.6;
  15. text-align: left;
  16. text-align: start;
  17. text-decoration: none;
  18. text-shadow: none;
  19. text-transform: none;
  20. white-space: normal;
  21. word-break: normal;
  22. word-spacing: normal;
  23. word-wrap: normal;
  24. overflow-wrap: anywhere;
  25. font-size: 12px;
  26. opacity: 0;
  27. z-index: 100000;
  28. /* default to top */
  29. margin-top: -3px;
  30. padding: 10px 0;
  31. filter: drop-shadow(0 1px 10px var(--color-box-shadow));
  32. &.in,
  33. &.show,
  34. &.tooltip[aria-hidden='false'] {
  35. visibility: visible;
  36. opacity: 1;
  37. transition: opacity .15s;
  38. }
  39. &.top .tooltip-arrow,
  40. &[x-placement^='top'] {
  41. left: 50%;
  42. margin-left: -10px;
  43. }
  44. &.bottom,
  45. &[x-placement^='bottom'] {
  46. margin-top: 3px;
  47. padding: 10px 0;
  48. }
  49. &.right,
  50. &[x-placement^='right'] {
  51. margin-left: 3px;
  52. padding: 0 10px;
  53. .tooltip-arrow {
  54. top: 50%;
  55. left: 0;
  56. margin-top: -10px;
  57. border-width: 10px 10px 10px 0;
  58. border-right-color: var(--color-main-background);
  59. }
  60. }
  61. &.left,
  62. &[x-placement^='left'] {
  63. margin-left: -3px;
  64. padding: 0 5px;
  65. .tooltip-arrow {
  66. top: 50%;
  67. right: 0;
  68. margin-top: -10px;
  69. border-width: 10px 0 10px 10px;
  70. border-left-color: var(--color-main-background);
  71. }
  72. }
  73. /* TOP */
  74. &.top,
  75. &.top-left,
  76. &[x-placement^='top'],
  77. &.top-right {
  78. .tooltip-arrow, .arrow {
  79. bottom: 0;
  80. border-width: 10px 10px 0;
  81. border-top-color: var(--color-main-background);
  82. }
  83. }
  84. &.top-left .tooltip-arrow {
  85. right: 10px;
  86. margin-bottom: -10px;
  87. }
  88. &.top-right .tooltip-arrow {
  89. left: 10px;
  90. margin-bottom: -10px;
  91. }
  92. /* BOTTOM */
  93. &.bottom,
  94. &[x-placement^='bottom'],
  95. &.bottom-left,
  96. &.bottom-right {
  97. .tooltip-arrow, .arrow {
  98. top: 0;
  99. border-width: 0 10px 10px;
  100. border-bottom-color: var(--color-main-background);
  101. }
  102. }
  103. &[x-placement^='bottom'] .tooltip-arrow,
  104. &.bottom .tooltip-arrow {
  105. left: 50%;
  106. margin-left: -10px;
  107. }
  108. &.bottom-left .tooltip-arrow {
  109. right: 10px;
  110. margin-top: -10px;
  111. }
  112. &.bottom-right .tooltip-arrow {
  113. left: 10px;
  114. margin-top: -10px;
  115. }
  116. }
  117. .tooltip-inner {
  118. max-width: 350px;
  119. padding: 5px 8px;
  120. background-color: var(--color-main-background);
  121. color: var(--color-main-text);
  122. text-align: center;
  123. border-radius: var(--border-radius);
  124. }
  125. .tooltip-arrow, .tooltip .arrow {
  126. position: absolute;
  127. width: 0;
  128. height: 0;
  129. border-color: transparent;
  130. border-style: solid;
  131. }