scrollList.scss 6.1 KB

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