autocomplete.scss 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. @use 'sass:map';
  2. @use 'mixins/mixins' as *;
  3. @use 'mixins/utils' as *;
  4. @use 'common/var' as *;
  5. @include b(autocomplete) {
  6. position: relative;
  7. display: inline-block;
  8. @include e(popper) {
  9. @include picker-popper(
  10. getCssVar('bg-color', 'overlay'),
  11. 1px solid getCssVar('border-color', 'light'),
  12. getCssVar('box-shadow', 'light')
  13. );
  14. }
  15. }
  16. @include b(autocomplete-suggestion) {
  17. border-radius: getCssVar('border-radius', 'base');
  18. box-sizing: border-box;
  19. @include e(wrap) {
  20. max-height: 280px;
  21. padding: 10px 0;
  22. box-sizing: border-box;
  23. }
  24. @include e(list) {
  25. margin: 0;
  26. padding: 0;
  27. }
  28. & li {
  29. padding: 0 20px;
  30. margin: 0;
  31. line-height: 34px;
  32. cursor: pointer;
  33. color: getCssVar('text-color', 'regular');
  34. font-size: getCssVar('font-size', 'base');
  35. list-style: none;
  36. text-align: left;
  37. white-space: nowrap;
  38. overflow: hidden;
  39. text-overflow: ellipsis;
  40. &:hover {
  41. background-color: map.get($select-option, 'hover-background');
  42. }
  43. &.highlighted {
  44. background-color: map.get($select-option, 'hover-background');
  45. }
  46. &.divider {
  47. margin-top: 6px;
  48. border-top: 1px solid getCssVar('color', 'black');
  49. }
  50. &.divider:last-child {
  51. margin-bottom: -6px;
  52. }
  53. }
  54. @include when(loading) {
  55. li {
  56. text-align: center;
  57. height: 100px;
  58. line-height: 100px;
  59. font-size: 20px;
  60. color: getCssVar('text-color', 'secondary');
  61. @include utils-vertical-center;
  62. &:hover {
  63. background-color: getCssVar('bg-color', 'overlay');
  64. }
  65. }
  66. & .#{$namespace}-icon-loading {
  67. vertical-align: middle;
  68. }
  69. }
  70. }