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.

Tooltip.css 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2022 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. .tooltip {
  21. position: absolute;
  22. z-index: var(--tooltipZIndex);
  23. display: block;
  24. height: auto;
  25. box-sizing: border-box;
  26. font-size: var(--baseFontSize);
  27. font-weight: 300;
  28. line-height: 1.5;
  29. animation: fadeIn 0.3s forwards;
  30. }
  31. .tooltip.top {
  32. padding: 5px 0;
  33. margin-top: -3px;
  34. }
  35. .tooltip.right {
  36. padding: 0 5px;
  37. margin-left: 3px;
  38. }
  39. .tooltip.bottom {
  40. padding: 5px 0;
  41. margin-top: 3px;
  42. }
  43. .tooltip.left {
  44. padding: 0 5px;
  45. margin-left: -3px;
  46. }
  47. .tooltip-inner {
  48. max-width: 300px;
  49. text-align: left;
  50. text-decoration: none;
  51. border-radius: 4px;
  52. overflow: hidden;
  53. word-break: break-word;
  54. padding: 12px 17px;
  55. color: #fff;
  56. background-color: #475760;
  57. letter-spacing: 0.04em;
  58. }
  59. .tooltip-inner .alert {
  60. margin-bottom: 5px;
  61. border-radius: 4px;
  62. }
  63. .tooltip-inner a {
  64. border-bottom-color: #8da6b3;
  65. color: #a5d0ea;
  66. }
  67. .tooltip-inner hr {
  68. background-color: #5d6d75;
  69. }
  70. .tooltip-arrow {
  71. position: absolute;
  72. width: 0;
  73. height: 0;
  74. border: solid transparent;
  75. }
  76. .tooltip.top .tooltip-arrow {
  77. bottom: 0;
  78. left: 50%;
  79. border-width: 5px 5px 0;
  80. transform: translateX(-5px);
  81. border-top-color: #475760;
  82. }
  83. .tooltip.right .tooltip-arrow {
  84. top: 50%;
  85. left: 0;
  86. transform: translateY(-5px);
  87. border-width: 5px 5px 5px 0;
  88. border-right-color: #475760;
  89. }
  90. .tooltip.left .tooltip-arrow {
  91. top: 50%;
  92. right: 0;
  93. transform: translateY(-5px);
  94. border-width: 5px 0 5px 5px;
  95. border-left-color: #475760;
  96. }
  97. .tooltip.bottom .tooltip-arrow {
  98. top: 0;
  99. left: 50%;
  100. transform: translateX(-5px);
  101. border-width: 0 5px 5px;
  102. border-bottom-color: #475760;
  103. }
  104. /* Workaround for react issue with onMouseLeave in disabled buttons: https://github.com/facebook/react/issues/4251 */
  105. .tooltip button[disabled] {
  106. pointer-events: none;
  107. }
  108. @keyframes fadeIn {
  109. from {
  110. opacity: 0;
  111. }
  112. to {
  113. opacity: 1;
  114. }
  115. }