智慧水务管理系统 - 精河县供水工程综合管理平台

popper.scss 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. @include set-css-var-value(
  21. ('fill-color', 'blank'),
  22. getCssVar('popper', 'bg-color-dark')
  23. );
  24. color: getCssVar('bg-color');
  25. background: getCssVar('popper', 'bg-color-dark');
  26. border: 1px solid getCssVar('text-color', 'primary');
  27. > #{$arrow-selector}::before {
  28. border: 1px solid getCssVar('text-color', 'primary');
  29. background: getCssVar('popper', 'bg-color-dark');
  30. right: 0;
  31. }
  32. }
  33. @include when(light) {
  34. @include set-css-var-value(
  35. ('fill-color', 'blank'),
  36. getCssVar('popper', 'bg-color-light')
  37. );
  38. background: getCssVar('popper', 'bg-color-light');
  39. border: 1px solid getCssVar('border-color', 'light');
  40. > #{$arrow-selector}::before {
  41. border: 1px solid getCssVar('border-color', 'light');
  42. background: getCssVar('popper', 'bg-color-light');
  43. right: 0;
  44. }
  45. }
  46. @include when(pure) {
  47. padding: 0;
  48. }
  49. @include e(arrow) {
  50. position: absolute;
  51. width: 10px;
  52. height: 10px;
  53. z-index: -1;
  54. &::before {
  55. position: absolute;
  56. width: 10px;
  57. height: 10px;
  58. z-index: -1;
  59. content: ' ';
  60. transform: rotate(45deg);
  61. background: getCssVar('text-color', 'primary');
  62. box-sizing: border-box;
  63. }
  64. }
  65. $placements: (
  66. 'top': 'bottom',
  67. 'bottom': 'top',
  68. 'left': 'right',
  69. 'right': 'left',
  70. );
  71. @each $placement, $opposite in $placements {
  72. &[data-popper-placement^='#{$placement}'] > #{$arrow-selector} {
  73. #{$opposite}: -5px;
  74. &::before {
  75. @if $placement == top {
  76. border-bottom-right-radius: 2px;
  77. }
  78. @if $placement == bottom {
  79. border-top-left-radius: 2px;
  80. }
  81. @if $placement == left {
  82. border-top-right-radius: 2px;
  83. }
  84. @if $placement == right {
  85. border-bottom-left-radius: 2px;
  86. }
  87. }
  88. }
  89. }
  90. @each $placement,
  91. $adjacency
  92. in ('top': 'left', 'bottom': 'right', 'left': 'bottom', 'right': 'top')
  93. {
  94. &[data-popper-placement^='#{$placement}'] > {
  95. #{$arrow-selector}::before {
  96. border-#{$placement}-color: transparent !important;
  97. border-#{$adjacency}-color: transparent !important;
  98. }
  99. }
  100. }
  101. }