arrow.scss 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. @mixin minWidth() {
  2. &.#{$module}-with-arrow,
  3. .#{$module}-with-arrow {
  4. min-width: $spacing-tooltip_arrow_adjusted_offset-x * 2 + $width-tooltip_arrow;
  5. }
  6. }
  7. @mixin minHeight() {
  8. &.#{$module}-with-arrow,
  9. .#{$module}-with-arrow {
  10. min-height: $height-tooltip_arrow_vertical + $spacing-tooltip_arrow_adjusted_offset-y * 2;
  11. }
  12. }
  13. .#{$module} {
  14. &-wrapper {
  15. .#{$module-icon} {
  16. height: $height-tooltip_arrow;
  17. width: $width-tooltip_arrow;
  18. position: absolute;
  19. color:$color-tooltip_arrow-icon-default;
  20. }
  21. &[x-placement='top'] {
  22. .#{$module-icon} {
  23. left: 50%;
  24. transform: translateX(-50%);
  25. bottom: (-$height-tooltip_arrow + $spacing-tooltip_arrow_offset-y);
  26. }
  27. @include minWidth();
  28. }
  29. &[x-placement='topLeft'] {
  30. .#{$module-icon} {
  31. bottom: (-$height-tooltip_arrow + $spacing-tooltip_arrow_offset-y);
  32. left: $spacing-tooltip_arrow_adjusted_offset-x;
  33. }
  34. @include minWidth();
  35. }
  36. &[x-placement='topRight'] {
  37. .#{$module-icon} {
  38. bottom: (-$height-tooltip_arrow + $spacing-tooltip_arrow_offset-y);
  39. right: $spacing-tooltip_arrow_adjusted_offset-x;
  40. }
  41. @include minWidth();
  42. }
  43. &[x-placement='leftTop'] {
  44. .#{$module-icon} {
  45. width: $width-tooltip_arrow_vertical;
  46. height: $height-tooltip_arrow_vertical;
  47. right: (-$width-tooltip_arrow_vertical + $spacing-tooltip_arrow_offset-x);
  48. top: $vertical-rate * $height-tooltip_arrow_vertical + $spacing-tooltip_arrow_adjusted_offset-y;
  49. }
  50. @include minHeight();
  51. }
  52. &[x-placement='left'] {
  53. .#{$module-icon} {
  54. width: $width-tooltip_arrow_vertical;
  55. height: $height-tooltip_arrow_vertical;
  56. right: (-$width-tooltip_arrow_vertical + $spacing-tooltip_arrow_offset-x);
  57. top: 50%;
  58. transform: translateY(-50%);
  59. }
  60. @include minHeight();
  61. }
  62. &[x-placement='leftBottom'] {
  63. .#{$module-icon} {
  64. width: $width-tooltip_arrow_vertical;
  65. height: $height-tooltip_arrow_vertical;
  66. right: (-$width-tooltip_arrow_vertical + $spacing-tooltip_arrow_offset-x);
  67. bottom: $vertical-rate * $height-tooltip_arrow_vertical + $spacing-tooltip_arrow_adjusted_offset-y;
  68. }
  69. @include minHeight();
  70. }
  71. &[x-placement='rightTop'] {
  72. .#{$module-icon} {
  73. width: $width-tooltip_arrow_vertical;
  74. height: $height-tooltip_arrow_vertical;
  75. left: -$width-tooltip_arrow_vertical + $spacing-tooltip_arrow_offset-x;
  76. top: $vertical-rate * $height-tooltip_arrow_vertical + $spacing-tooltip_arrow_adjusted_offset-y;
  77. transform: rotate(180deg);
  78. }
  79. @include minHeight();
  80. }
  81. &[x-placement='right'] {
  82. .#{$module-icon} {
  83. width: $width-tooltip_arrow_vertical;
  84. height: $height-tooltip_arrow_vertical;
  85. left: -$width-tooltip_arrow_vertical + $spacing-tooltip_arrow_offset-x;
  86. top: 50%;
  87. transform: translateY(-50%) rotate(180deg);
  88. }
  89. @include minHeight();
  90. }
  91. &[x-placement='rightBottom'] {
  92. .#{$module-icon} {
  93. width: $width-tooltip_arrow_vertical;
  94. height: $height-tooltip_arrow_vertical;
  95. left: -$width-tooltip_arrow_vertical + $spacing-tooltip_arrow_offset-x;
  96. bottom: $vertical-rate * $height-tooltip_arrow_vertical + $spacing-tooltip_arrow_adjusted_offset-y;
  97. transform: rotate(180deg);
  98. }
  99. @include minHeight();
  100. }
  101. &[x-placement='bottomLeft'] {
  102. .#{$module-icon} {
  103. top: (-$height-tooltip_arrow + $spacing-tooltip_arrow_offset-y);
  104. left: $spacing-tooltip_arrow_adjusted_offset-x;
  105. transform: rotate(180deg);
  106. }
  107. @include minWidth();
  108. }
  109. &[x-placement='bottom'] {
  110. .#{$module-icon} {
  111. top: (-$height-tooltip_arrow + $spacing-tooltip_arrow_offset-y);
  112. left: 50%;
  113. transform: translateX(-50%) rotate(180deg);
  114. }
  115. @include minWidth();
  116. }
  117. &[x-placement='bottomRight'] {
  118. .#{$module-icon} {
  119. right: $spacing-tooltip_arrow_adjusted_offset-x;
  120. top: (-$height-tooltip_arrow + $spacing-tooltip_arrow_offset-y);
  121. transform: rotate(180deg);
  122. }
  123. @include minWidth();
  124. }
  125. }
  126. }