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 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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 corner radius for tooltips.
  59. *
  60. * @type size
  61. * @group tooltip
  62. */
  63. $v-tooltip-border-radius: $v-border-radius - 1px !default;
  64. /**
  65. * Outputs the selectors and styles for tooltip elements.
  66. *
  67. * @group tooltip
  68. */
  69. @mixin valo-tooltip {
  70. .v-tooltip {
  71. @include valo-tooltip-style;
  72. div[style*="width"] {
  73. width: auto !important;
  74. }
  75. .v-errormessage {
  76. background-color: opacify($v-tooltip-error-message-background-color, 1);
  77. background-color: $v-tooltip-error-message-background-color;
  78. color: $v-tooltip-error-message-font-color;
  79. margin: -$v-tooltip-padding-vertical #{-$v-tooltip-padding-horizontal};
  80. padding: $v-tooltip-padding-vertical $v-tooltip-padding-horizontal;
  81. max-height: 10em;
  82. overflow: auto;
  83. font-weight: $v-font-weight + 100;
  84. h2:only-child {
  85. font: inherit;
  86. line-height: inherit;
  87. }
  88. }
  89. .v-tooltip-text {
  90. max-height: 10em;
  91. overflow: auto;
  92. margin-top: $v-tooltip-padding-vertical * 2;
  93. pre {
  94. margin: 0px;
  95. }
  96. }
  97. .v-errormessage[aria-hidden="true"] + .v-tooltip-text {
  98. margin-top: 0;
  99. }
  100. h1,
  101. h2,
  102. h3,
  103. h4 {
  104. color: inherit;
  105. }
  106. }
  107. }
  108. /**
  109. * Outputs the main styles for tooltip elements.
  110. *
  111. * @group tooltip
  112. */
  113. @mixin valo-tooltip-style {
  114. background-color: $v-tooltip-background-color;
  115. @include box-shadow($v-tooltip-box-shadow);
  116. color: $v-tooltip-font-color;
  117. padding: $v-tooltip-padding-vertical $v-tooltip-padding-horizontal;
  118. border-radius: $v-tooltip-border-radius;
  119. max-width: 35em;
  120. overflow: hidden !important;
  121. font-size: $v-tooltip-font-size;
  122. }