8838ce6eb9e622afcafdbcc0e3586927a7fd8ab3f092d9c304bff6f125ba75bbf0b456305b99df082c7e12e0a3e7e0fb1769fe11ac84b0665fb5a630a1000a 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. @import "mixins/mixins";
  2. @import "common/var";
  3. @include b(tooltip) {
  4. &:focus:not(.focusing), &:focus:hover {
  5. outline-width: 0;
  6. }
  7. @include e(popper) {
  8. position: absolute;
  9. border-radius: 4px;
  10. padding: $--tooltip-padding;
  11. z-index: $--index-popper;
  12. font-size: $--tooltip-font-size;
  13. line-height: 1.2;
  14. min-width: 10px;
  15. word-wrap: break-word;
  16. .popper__arrow,
  17. .popper__arrow::after {
  18. position: absolute;
  19. display: block;
  20. width: 0;
  21. height: 0;
  22. border-color: transparent;
  23. border-style: solid;
  24. }
  25. .popper__arrow {
  26. border-width: $--tooltip-arrow-size;
  27. }
  28. .popper__arrow::after {
  29. content: " ";
  30. border-width: 5px;
  31. }
  32. &[x-placement^="top"] {
  33. margin-bottom: #{$--tooltip-arrow-size + 6px};
  34. }
  35. &[x-placement^="top"] .popper__arrow {
  36. bottom: -$--tooltip-arrow-size;
  37. border-top-color: $--tooltip-border-color;
  38. border-bottom-width: 0;
  39. &::after {
  40. bottom: 1px;
  41. margin-left: -5px;
  42. border-top-color: $--tooltip-fill;
  43. border-bottom-width: 0;
  44. }
  45. }
  46. &[x-placement^="bottom"] {
  47. margin-top: #{$--tooltip-arrow-size + 6px};
  48. }
  49. &[x-placement^="bottom"] .popper__arrow {
  50. top: -$--tooltip-arrow-size;
  51. border-top-width: 0;
  52. border-bottom-color: $--tooltip-border-color;
  53. &::after {
  54. top: 1px;
  55. margin-left: -5px;
  56. border-top-width: 0;
  57. border-bottom-color: $--tooltip-fill;
  58. }
  59. }
  60. &[x-placement^="right"] {
  61. margin-left: #{$--tooltip-arrow-size + 6px};
  62. }
  63. &[x-placement^="right"] .popper__arrow {
  64. left: -$--tooltip-arrow-size;
  65. border-right-color: $--tooltip-border-color;
  66. border-left-width: 0;
  67. &::after {
  68. bottom: -5px;
  69. left: 1px;
  70. border-right-color: $--tooltip-fill;
  71. border-left-width: 0;
  72. }
  73. }
  74. &[x-placement^="left"] {
  75. margin-right: #{$--tooltip-arrow-size + 6px};
  76. }
  77. &[x-placement^="left"] .popper__arrow {
  78. right: -$--tooltip-arrow-size;
  79. border-right-width: 0;
  80. border-left-color: $--tooltip-border-color;
  81. &::after {
  82. right: 1px;
  83. bottom: -5px;
  84. margin-left: -5px;
  85. border-right-width: 0;
  86. border-left-color: $--tooltip-fill;
  87. }
  88. }
  89. @include when(dark) {
  90. background: $--tooltip-fill;
  91. color: $--tooltip-color;
  92. }
  93. @include when(light) {
  94. background: $--tooltip-color;
  95. border: 1px solid $--tooltip-fill;
  96. &[x-placement^="top"] .popper__arrow {
  97. border-top-color: $--tooltip-fill;
  98. &::after {
  99. border-top-color: $--tooltip-color;
  100. }
  101. }
  102. &[x-placement^="bottom"] .popper__arrow {
  103. border-bottom-color: $--tooltip-fill;
  104. &::after {
  105. border-bottom-color: $--tooltip-color;
  106. }
  107. }
  108. &[x-placement^="left"] .popper__arrow {
  109. border-left-color: $--tooltip-fill;
  110. &::after {
  111. border-left-color: $--tooltip-color;
  112. }
  113. }
  114. &[x-placement^="right"] .popper__arrow {
  115. border-right-color: $--tooltip-fill;
  116. &::after {
  117. border-right-color: $--tooltip-color;
  118. }
  119. }
  120. }
  121. }
  122. }