scrollList.scss 5.8 KB

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