1
0

tooltip.scss 3.3 KB

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