cdbc60cfca46d54033b03fc6498aaf3820d28a4457c361aac5eb1225c21cc9a7ef2e0695daaa3bfb475379bff6a32509d1cb127b3a00afc2f0704a84ab69f9 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/var' as *;
  3. @use 'common/var' as *;
  4. @include b(popper) {
  5. @include set-component-css-var('popper', $popper);
  6. }
  7. @include b(popper) {
  8. position: absolute;
  9. border-radius: getCssVar('popper', 'border-radius');
  10. padding: 5px 11px;
  11. z-index: 2000;
  12. font-size: 12px;
  13. line-height: 20px;
  14. min-width: 10px;
  15. overflow-wrap: break-word;
  16. word-break: normal;
  17. visibility: visible;
  18. $arrow-selector: #{& + '__arrow'};
  19. @include when(dark) {
  20. color: getCssVar('bg-color');
  21. background: getCssVar('text-color', 'primary');
  22. border: 1px solid getCssVar('text-color', 'primary');
  23. > #{$arrow-selector}::before {
  24. border: 1px solid getCssVar('text-color', 'primary');
  25. background: getCssVar('text-color', 'primary');
  26. right: 0;
  27. }
  28. }
  29. @include when(light) {
  30. background: getCssVar('bg-color', 'overlay');
  31. border: 1px solid getCssVar('border-color', 'light');
  32. > #{$arrow-selector}::before {
  33. border: 1px solid getCssVar('border-color', 'light');
  34. background: getCssVar('bg-color', 'overlay');
  35. right: 0;
  36. }
  37. }
  38. @include when(pure) {
  39. padding: 0;
  40. }
  41. @include e(arrow) {
  42. position: absolute;
  43. width: 10px;
  44. height: 10px;
  45. z-index: -1;
  46. &::before {
  47. position: absolute;
  48. width: 10px;
  49. height: 10px;
  50. z-index: -1;
  51. content: ' ';
  52. transform: rotate(45deg);
  53. background: getCssVar('text-color', 'primary');
  54. box-sizing: border-box;
  55. }
  56. }
  57. $placements: (
  58. 'top': 'bottom',
  59. 'bottom': 'top',
  60. 'left': 'right',
  61. 'right': 'left',
  62. );
  63. @each $placement, $opposite in $placements {
  64. &[data-popper-placement^='#{$placement}'] > #{$arrow-selector} {
  65. #{$opposite}: -5px;
  66. &::before {
  67. @if $placement == top {
  68. border-bottom-right-radius: 2px;
  69. }
  70. @if $placement == bottom {
  71. border-top-left-radius: 2px;
  72. }
  73. @if $placement == left {
  74. border-top-right-radius: 2px;
  75. }
  76. @if $placement == right {
  77. border-bottom-left-radius: 2px;
  78. }
  79. }
  80. }
  81. }
  82. @each $placement,
  83. $adjacency
  84. in ('top': 'left', 'bottom': 'right', 'left': 'bottom', 'right': 'top')
  85. {
  86. &[data-popper-placement^='#{$placement}'] > {
  87. #{$arrow-selector}::before {
  88. border-#{$placement}-color: transparent !important;
  89. border-#{$adjacency}-color: transparent !important;
  90. }
  91. }
  92. }
  93. }