index.less 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. @import (reference) './variable.less';
  2. @tabsPrefix: ant-tabs;
  3. .@{tabsPrefix} {
  4. width: 100%;
  5. &-bar {
  6. position: relative;
  7. width: 100%;
  8. display: flex;
  9. align-content: stretch;
  10. background-color: @tabs-inverse-color;
  11. box-sizing: border-box;
  12. &-underline {
  13. border-bottom: @border-width-standard solid @COLOR_BORDER;
  14. }
  15. &-fade {
  16. position: absolute;
  17. top: 0;
  18. bottom: 0;
  19. z-index: 9;
  20. width: 36 * @rpx;
  21. background-color: @tabs-inverse-color;
  22. pointer-events: none;
  23. &-left {
  24. left: 0;
  25. background: linear-gradient(
  26. 90deg,
  27. @COLOR_WHITE_CHANGE,
  28. hsla(0, 0%, 100%, 0)
  29. );
  30. }
  31. &-right {
  32. right: 84 * @rpx;
  33. background: linear-gradient(
  34. 270deg,
  35. @COLOR_WHITE_CHANGE,
  36. hsla(0, 0%, 100%, 0)
  37. );
  38. }
  39. transition: all 0.2s;
  40. }
  41. &-plus {
  42. display: flex;
  43. width: 72 * @rpx;
  44. height: 72 * @rpx;
  45. color: @COLOR_BLACK_CHANGE;
  46. align-self: center;
  47. align-items: center;
  48. justify-content: center;
  49. overflow: hidden;
  50. margin-right: @h-spacing-large;
  51. order: 1;
  52. &:empty {
  53. display: none;
  54. ~ .@{tabsPrefix}-bar-fade-right {
  55. right: 0;
  56. }
  57. }
  58. }
  59. &-scroll-view {
  60. width: 100%;
  61. display: flex;
  62. flex-direction: row;
  63. justify-content: space-between;
  64. flex-wrap: nowrap;
  65. overflow: hidden;
  66. will-change: auto;
  67. &::-webkit-scrollbar {
  68. display: none;
  69. }
  70. }
  71. // 选项卡最后两项间距控制
  72. &-wrap {
  73. display: flex;
  74. flex-shrink: 0;
  75. &-capsule {
  76. flex: 1;
  77. }
  78. &:nth-of-type(2) .@{tabsPrefix}-bar-capsule,
  79. &:nth-of-type(2) .@{tabsPrefix}-bar-mixin {
  80. margin-left: @h-spacing-large;
  81. }
  82. &:nth-last-of-type(2) .@{tabsPrefix}-bar-capsule,
  83. &:nth-last-of-type(2) .@{tabsPrefix}-bar-mixin {
  84. margin-right: @h-spacing-large;
  85. }
  86. }
  87. // 选项卡的通用样式
  88. &-item {
  89. display: flex;
  90. align-items: center;
  91. justify-content: center;
  92. flex: 1 0 auto;
  93. font-size: @font-size-list;
  94. white-space: nowrap;
  95. color: @tabs-basic-color;
  96. .ant-badge {
  97. width: 100%;
  98. }
  99. }
  100. // 基础类型 tab 选项卡样式
  101. &-basic {
  102. position: relative;
  103. display: flex;
  104. align-items: center;
  105. padding: @v-spacing-standard @h-spacing-large;
  106. box-sizing: border-box;
  107. }
  108. &-basic&-active {
  109. color: @tabs-active-color;
  110. position: relative;
  111. &:after {
  112. content: '';
  113. position: absolute;
  114. bottom: 0;
  115. width: calc(100% - @h-spacing-large * 2);
  116. height: 4 * @rpx;
  117. overflow: hidden;
  118. font-size: 0;
  119. border-radius: @corner-radius-circle;
  120. box-sizing: border-box;
  121. background-color: @tabs-active-decorate-color;
  122. }
  123. }
  124. // 胶囊类型选项卡样式
  125. &-capsule {
  126. padding: @v-spacing-large 0;
  127. margin: 0 @h-spacing-large / 2;
  128. box-sizing: border-box;
  129. position: relative;
  130. &-title {
  131. flex: 1;
  132. justify-content: center;
  133. margin-right: 0;
  134. padding: @v-spacing-standard 30 * @rpx;
  135. font-size: 30 * @rpx;
  136. text-align: center;
  137. line-height: @line-height-base;
  138. border-radius: 10vh;
  139. background-color: @COLOR_GREY_CARD;
  140. border-bottom: 0 none;
  141. }
  142. }
  143. &-capsule&-active &-capsule-title {
  144. color: @COLOR_WHITE;
  145. background-color: @tabs-active-decorate-color;
  146. }
  147. // 混合类型的选项卡样式
  148. &-mixin {
  149. flex-direction: column;
  150. margin: 0 @h-spacing-standard;
  151. padding: @v-spacing-large 0;
  152. text-align: center;
  153. &-title {
  154. margin: 2 * @rpx 0;
  155. position: relative;
  156. }
  157. &-subtitle {
  158. padding: 0 @h-spacing-standard;
  159. font-size: @font-size-content;
  160. line-height: @line-height-paragraph;
  161. color: @tabs-weaken-color;
  162. border-radius: 50vh;
  163. background-color: @COLOR_GREY_CARD;
  164. margin: 2 * @rpx 0;
  165. }
  166. }
  167. &-mixin&-active &-mixin-title {
  168. color: @tabs-active-color;
  169. }
  170. &-mixin&-active &-mixin-subtitle {
  171. color: @COLOR_WHITE;
  172. background-color: @tabs-active-decorate-color;
  173. }
  174. // 禁用态选项卡样式
  175. &-disabled {
  176. opacity: @opacity-disabled;
  177. pointer-events: none;
  178. cursor: not-allowed;
  179. }
  180. }
  181. &-content {
  182. overflow: hidden;
  183. background-color: @COLOR_WHITE_CHANGE;
  184. color: @COLOR_TEXT_PRIMARY;
  185. }
  186. }
  187. @vtabsPrefix: ant-vtabs;
  188. .@{vtabsPrefix} {
  189. width: 100%;
  190. display: flex;
  191. flex-direction: row;
  192. &-bar {
  193. width: 210 * @rpx;
  194. overflow: hidden;
  195. &-scroll-view {
  196. display: flex;
  197. flex-direction: column;
  198. width: 100%;
  199. height: 100%;
  200. background-color: @COLOR_GREY_CARD;
  201. &::-webkit-scrollbar {
  202. display: none;
  203. }
  204. }
  205. &-item {
  206. position: relative;
  207. width: 100%;
  208. padding: @size-4 @h-spacing-large;
  209. overflow: hidden;
  210. display: flex;
  211. align-items: center;
  212. font-size: @font-size-content;
  213. line-height: 37 * @rpx;
  214. color: @COLOR_TEXT_PRIMARY;
  215. background-color: @COLOR_GREY_CARD;
  216. box-sizing: border-box;
  217. transition: background-color 100ms linear, color 300ms linear;
  218. &-wrap {
  219. background-color: @COLOR_CARD;
  220. }
  221. &-active {
  222. color: @COLOR_BRAND1;
  223. background-color: @COLOR_CARD;
  224. &::after {
  225. position: absolute;
  226. content: '';
  227. top: @size-4;
  228. bottom: @size-4;
  229. left: 0;
  230. width: @border-width-thick;
  231. border-radius: @corner-radius-sm;
  232. background-color: @COLOR_BRAND1;
  233. }
  234. }
  235. &-disabled {
  236. pointer-events: none;
  237. cursor: not-allowed;
  238. .@{vtabsPrefix}-bar-item-title,
  239. .@{vtabsPrefix}-bar-item-count {
  240. opacity: @opacity-disabled;
  241. }
  242. }
  243. &-count {
  244. color: @COLOR_TEXT_WEAK;
  245. margin-left: @size-1;
  246. }
  247. &-icon {
  248. padding-left: 8 * @rpx;
  249. width: 28 * @rpx;
  250. height: 28 * @rpx;
  251. font-size: 26 * @rpx;
  252. overflow: hidden;
  253. position: relative;
  254. top: -4 * @rpx;
  255. display: flex;
  256. justify-content: center;
  257. align-items: center;
  258. &:empty {
  259. display: none;
  260. }
  261. }
  262. }
  263. }
  264. &-content {
  265. overflow: hidden;
  266. flex: 1;
  267. background-color: @COLOR_CARD;
  268. color: @COLOR_TEXT_PRIMARY;
  269. }
  270. }