scrollList.scss 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. //@import '../theme/variables.scss';
  2. // @import '../theme/_font.scss';
  3. @import './animation.scss';
  4. @import './variables.scss';
  5. $module: #{$prefix}-scrolllist;
  6. .#{$module} {
  7. width: 100%;
  8. height: 100%;
  9. background: $color-scrollList-bg;
  10. box-shadow: $shadow-scrollList;
  11. border-radius: $radius-scrollList;
  12. overflow: hidden;
  13. @include font-size-regular;
  14. user-select: none;
  15. display: flex;
  16. flex-direction: column;
  17. &-header {
  18. text-align: center;
  19. padding: $spacing-scrollList_header-paddingY $spacing-scrollList_header-paddingX;
  20. background: $color-scrollList_header-bg;
  21. &-title {
  22. padding: $spacing-scrollList_header_title-paddingY $spacing-scrollList_header_title-paddingX;
  23. font-weight: $font-scrollList_header_title-fontWeight;
  24. color: $color-scrollList_header-title;
  25. @include font-size-regular;
  26. }
  27. }
  28. &-body {
  29. display: flex;
  30. height: $height-scrollList;
  31. padding: $spacing-scrollList_body-paddingY $spacing-scrollList_body-paddingX;
  32. overflow: hidden;
  33. .#{$module}-item-wheel .#{$module}-list-outer-nocycle,
  34. .#{$module}-item {
  35. & > ul {
  36. &:before {
  37. content: '';
  38. display: block;
  39. width: 100%;
  40. height: ($height-scrollList - $height-scrollList_item) * 0.5;
  41. }
  42. }
  43. }
  44. .#{$module}-item {
  45. position: relative;
  46. flex: 1;
  47. overflow-x: hidden;
  48. overflow-y: auto;
  49. &:not(:last-child) {
  50. border-right: $width-scrollList_item-border solid $color-scrollList-border;
  51. }
  52. }
  53. .#{$module}-item,
  54. .#{$module}-item-wheel .#{$module}-list-outer {
  55. & > ul {
  56. box-sizing: border-box;
  57. width: 100%;
  58. margin: $spacing-scrollList_item_ul-margin;
  59. padding: $spacing-scrollList_item_ul-padding;
  60. padding-bottom: $spacing-scrollList_item_ul-paddingBottom;
  61. list-style: none;
  62. & > li {
  63. list-style: none;
  64. height: $height-scrollList_item;
  65. box-sizing: border-box;
  66. color: $color-scrollList_item-text;
  67. text-align: center;
  68. display: flex;
  69. align-items: center;
  70. justify-content: center;
  71. // padding: 8px 18px;
  72. cursor: pointer;
  73. background-color: $color-scrollList_item-bg;
  74. transition: background-color $transition_duration-scrollList_selected_item-bg $transition_function-scrollList_selected_item-bg $transition_delay-scrollList_selected_item-bg;
  75. &.#{$module}-item-sel {
  76. background: $color-scrollList_selected_item-bg;
  77. color: $color-scrollList_selected_item-text;
  78. > svg {
  79. color: $color-scrollList_selected_item-icon;
  80. width: $width-scrollList_item_sel_svg;
  81. height: $width-scrollList_item_sel_svg;
  82. margin-right: $spacing-scrollList_item_sel_svg-marginRight;
  83. }
  84. }
  85. &:not(.disabled):not(.#{$module}-item-disabled):not(.#{$module}-item-sel):not(.#{$module}-item-selected) {
  86. cursor: pointer;
  87. &:hover {
  88. background-color: $color-scrollList_item-text-hover;
  89. }
  90. &:active {
  91. background-color: $color-scrollList_item-bg-active;
  92. }
  93. }
  94. &.#{$module}-item-disabled {
  95. color: $color-scrollList_disabled_item-text;
  96. cursor: not-allowed;
  97. }
  98. }
  99. }
  100. }
  101. .#{$module}-item-wheel {
  102. position: relative;
  103. flex: 1;
  104. overflow: hidden;
  105. &:not(:last-child) {
  106. border-right: $border-thickness-control solid $color-scrollList-border;
  107. }
  108. .#{$module}-item-selected {
  109. font-weight: $font-scrollList_item_wheel_item_selected-fontWeight;
  110. color: var(--semi-color-primary) !important;
  111. }
  112. .#{$module}-list-outer {
  113. overflow-x: hidden;
  114. overflow-y: auto;
  115. height: 100%;
  116. width: 100%;
  117. padding-right: $spacing-scrollList_item_wheel_list_outer-paddingRight;
  118. }
  119. .#{$module}-shade {
  120. width: 100%;
  121. height: 50%;
  122. pointer-events: none;
  123. position: absolute;
  124. &-pre {
  125. top: 0;
  126. margin-top: $spacing-scrollList_item_wheel_list_shade_pre-marginTop;
  127. background: $color-scrollList-bg;
  128. opacity: 0.5;
  129. }
  130. &-post {
  131. top: 50%;
  132. margin-top: $spacing-scrollList_item_wheel_list_shade_post-marginTop;
  133. background: $color-scrollList-bg;
  134. opacity: 0.5;
  135. }
  136. }
  137. .#{$module}-selector {
  138. pointer-events: none;
  139. position: absolute;
  140. top: 50%;
  141. border-top: $width-scrollList_item_wheel_selector-border solid $color-scrollList-border;
  142. border-bottom: $width-scrollList_item_wheel_selector-border solid $color-scrollList-border;
  143. height: $height-scrollList_item;
  144. width: 100%;
  145. transform: translateY(-50%);
  146. }
  147. }
  148. }
  149. .#{$module}-footer {
  150. border-top: $width-scrollList_footer-border solid $color-scrollList_footer-border;
  151. padding: $spacing-scrollList_footer-padding;
  152. }
  153. .#{$module}-line {
  154. background: $color-scrollList-border;
  155. height: $height-scrollList_line;
  156. }
  157. }
  158. @import './rtl.scss';