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.scss 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /**
  2. * The backgound color for tooltips.
  3. *
  4. * @type color
  5. * @group tooltip
  6. */
  7. $v-tooltip-background-color: rgba(if(is-dark-color($v-background-color), scale-color($v-background-color, $lightness: 80%), scale-color($v-background-color, $lightness: -80%)), .9) !default;
  8. /**
  9. * The font color for tooltips.
  10. *
  11. * @type color
  12. * @group tooltip
  13. */
  14. $v-tooltip-font-color: valo-font-color(opacify($v-tooltip-background-color, 1), 1) !default;
  15. /**
  16. * The font size for tooltips.
  17. *
  18. * @type size
  19. * @group tooltip
  20. */
  21. $v-tooltip-font-size: max(12px, round($v-font-size * 0.86)) !default;
  22. /**
  23. * The CSS box shadow for tooltips.
  24. *
  25. * @type list
  26. * @group tooltip
  27. */
  28. $v-tooltip-box-shadow: 0 2px 12px rgba(#000, .2) !default;
  29. /**
  30. * The vertical padding for tooltips.
  31. *
  32. * @type size
  33. * @group tooltip
  34. */
  35. $v-tooltip-padding-vertical: round($v-unit-size/8) !default;
  36. /**
  37. * The horizontal padding for tooltips.
  38. *
  39. * @type size
  40. * @group tooltip
  41. */
  42. $v-tooltip-padding-horizontal: round($v-unit-size/4) !default;
  43. /**
  44. * The backgound color for error tooltips.
  45. *
  46. * @type color
  47. * @group tooltip
  48. */
  49. $v-tooltip-error-message-background-color: #fff !default;
  50. /**
  51. * The font color for error tooltips.
  52. *
  53. * @type color
  54. * @group tooltip
  55. */
  56. $v-tooltip-error-message-font-color: $v-error-indicator-color !default;
  57. /**
  58. * The font color for error tooltips for level 'info'.
  59. *
  60. * @type color
  61. * @group tooltip
  62. */
  63. $v-tooltip-error-message-level-info-font-color: $v-error-indicator-level-info-color !default;
  64. /**
  65. * The font color for error tooltips for level 'warning'.
  66. *
  67. * @type color
  68. * @group tooltip
  69. */
  70. $v-tooltip-error-message-level-warning-font-color: $v-error-indicator-level-warning-color !default;
  71. /**
  72. * The font color for error tooltips for level 'error'.
  73. *
  74. * @type color
  75. * @group tooltip
  76. */
  77. $v-tooltip-error-message-level-error-font-color: $v-error-indicator-level-error-color !default;
  78. /**
  79. * The font color for error tooltips for level 'critical'.
  80. *
  81. * @type color
  82. * @group tooltip
  83. */
  84. $v-tooltip-error-message-level-critical-font-color: $v-error-indicator-level-critical-color !default;
  85. /**
  86. * The font color for error tooltips for level 'system'.
  87. *
  88. * @type color
  89. * @group tooltip
  90. */
  91. $v-tooltip-error-message-level-system-font-color: $v-error-indicator-level-system-color !default;
  92. /**
  93. * The corner radius for tooltips.
  94. *
  95. * @type size
  96. * @group tooltip
  97. */
  98. $v-tooltip-border-radius: $v-border-radius - 1px !default;
  99. /**
  100. * Outputs the selectors and styles for tooltip elements.
  101. *
  102. * @group tooltip
  103. */
  104. @mixin valo-tooltip {
  105. .v-tooltip {
  106. @include valo-tooltip-style;
  107. div[style*="width"] {
  108. width: auto !important;
  109. }
  110. .v-errormessage {
  111. background-color: opacify($v-tooltip-error-message-background-color, 1);
  112. background-color: $v-tooltip-error-message-background-color;
  113. color: $v-tooltip-error-message-font-color;
  114. margin: -$v-tooltip-padding-vertical #{-$v-tooltip-padding-horizontal};
  115. padding: $v-tooltip-padding-vertical $v-tooltip-padding-horizontal;
  116. max-height: 10em;
  117. overflow: auto;
  118. font-weight: $v-font-weight + 100;
  119. h2:only-child {
  120. font: inherit;
  121. line-height: inherit;
  122. }
  123. }
  124. .v-errormessage-info {
  125. color: $v-tooltip-error-message-level-info-font-color;
  126. }
  127. .v-errormessage-warning {
  128. color: $v-tooltip-error-message-level-warning-font-color;
  129. }
  130. .v-errormessage-error {
  131. color: $v-tooltip-error-message-level-error-font-color;
  132. }
  133. .v-errormessage-critical {
  134. color: $v-tooltip-error-message-level-critical-font-color;
  135. }
  136. .v-errormessage-system {
  137. color: $v-tooltip-error-message-level-system-font-color;
  138. }
  139. .v-tooltip-text {
  140. max-height: 10em;
  141. overflow: auto;
  142. margin-top: $v-tooltip-padding-vertical * 2;
  143. }
  144. .v-errormessage[aria-hidden="true"] + .v-tooltip-text {
  145. margin-top: 0;
  146. }
  147. h1,
  148. h2,
  149. h3,
  150. h4 {
  151. color: inherit;
  152. }
  153. pre.v-tooltip-pre {
  154. font: inherit;
  155. white-space: pre-wrap;
  156. margin: 0;
  157. }
  158. }
  159. }
  160. /**
  161. * Outputs the main styles for tooltip elements.
  162. *
  163. * @group tooltip
  164. */
  165. @mixin valo-tooltip-style {
  166. background-color: opacify($v-tooltip-background-color, 1); // For IE8
  167. background-color: $v-tooltip-background-color;
  168. @include box-shadow($v-tooltip-box-shadow);
  169. color: $v-tooltip-font-color;
  170. padding: $v-tooltip-padding-vertical $v-tooltip-padding-horizontal;
  171. border-radius: $v-tooltip-border-radius;
  172. max-width: 35em;
  173. overflow: hidden !important;
  174. font-size: $v-tooltip-font-size;
  175. }