autocomplete.scss 1.8 KB

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