cascader-panel.scss 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/var' as *;
  3. @use 'common/var' as *;
  4. @include b(cascader-panel) {
  5. @include set-component-css-var('cascader', $cascader);
  6. }
  7. @include b(cascader-panel) {
  8. display: flex;
  9. border-radius: getCssVar('cascader-menu', 'radius');
  10. font-size: getCssVar('cascader-menu', 'font-size');
  11. @include when(bordered) {
  12. border: getCssVar('cascader-menu', 'border');
  13. border-radius: getCssVar('cascader-menu', 'radius');
  14. }
  15. }
  16. @include b(cascader-menu) {
  17. min-width: 180px;
  18. box-sizing: border-box;
  19. color: getCssVar('cascader-menu', 'text-color');
  20. border-right: getCssVar('cascader-menu', 'border');
  21. &:last-child {
  22. border-right: none;
  23. .#{$namespace}-cascader-node {
  24. padding-right: 20px;
  25. }
  26. }
  27. @include e(wrap) {
  28. // Raise the priority
  29. &.#{$namespace}-scrollbar__wrap {
  30. height: 204px;
  31. }
  32. }
  33. @include e(list) {
  34. position: relative;
  35. min-height: 100%;
  36. margin: 0;
  37. padding: 6px 0;
  38. list-style: none;
  39. box-sizing: border-box;
  40. }
  41. @include e(hover-zone) {
  42. position: absolute;
  43. top: 0;
  44. left: 0;
  45. width: 100%;
  46. height: 100%;
  47. pointer-events: none;
  48. }
  49. @include e(empty-text) {
  50. position: absolute;
  51. top: 50%;
  52. left: 50%;
  53. transform: translate(-50%, -50%);
  54. display: flex;
  55. align-items: center;
  56. color: getCssVar('cascader', 'color-empty');
  57. .is-loading {
  58. margin-right: 2px;
  59. }
  60. }
  61. }
  62. @include b(cascader-node) {
  63. position: relative;
  64. display: flex;
  65. align-items: center;
  66. padding: 0 30px 0 20px;
  67. height: 34px;
  68. line-height: 34px;
  69. outline: none;
  70. &.is-selectable.in-active-path {
  71. color: getCssVar('cascader-menu', 'text-color');
  72. }
  73. &.in-active-path,
  74. &.is-selectable.in-checked-path,
  75. &.is-active {
  76. color: getCssVar('cascader-menu', 'selected-text-color');
  77. font-weight: bold;
  78. }
  79. &:not(.is-disabled) {
  80. cursor: pointer;
  81. &:hover,
  82. &:focus {
  83. background: getCssVar('cascader-node', 'background-hover');
  84. }
  85. }
  86. @include when(disabled) {
  87. color: getCssVar('cascader-node', 'color-disabled');
  88. cursor: not-allowed;
  89. }
  90. @include e(prefix) {
  91. position: absolute;
  92. left: 10px;
  93. }
  94. @include e(postfix) {
  95. position: absolute;
  96. right: 10px;
  97. }
  98. @include e(label) {
  99. flex: 1;
  100. text-align: left;
  101. padding: 0 8px;
  102. white-space: nowrap;
  103. overflow: hidden;
  104. text-overflow: ellipsis;
  105. }
  106. > .#{$namespace}-checkbox {
  107. margin-right: 0;
  108. }
  109. > .#{$namespace}-radio {
  110. margin-right: 0;
  111. .#{$namespace}-radio__label {
  112. padding-left: 0;
  113. }
  114. }
  115. }