tabs.scss 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. .cl-tabs {
  2. width: 100%;
  3. &__header {
  4. display: flex;
  5. height: 80rpx;
  6. position: relative;
  7. }
  8. &__bar {
  9. white-space: nowrap;
  10. box-sizing: border-box;
  11. flex: 1;
  12. .uni-scroll-view::-webkit-scrollbar {
  13. display: none;
  14. }
  15. &-box {
  16. display: inline-flex;
  17. position: relative;
  18. height: 100%;
  19. width: 100%;
  20. }
  21. &-item {
  22. display: inline-flex;
  23. align-items: center;
  24. justify-content: center;
  25. height: 100%;
  26. font-size: 28rpx;
  27. box-sizing: border-box;
  28. .cl-tabs__icon {
  29. font-size: 30rpx;
  30. &--prefix {
  31. margin-right: 10rpx;
  32. }
  33. &--suffix {
  34. margin-left: 10rpx;
  35. }
  36. }
  37. &.is-active {
  38. color: $cl-color-primary;
  39. }
  40. }
  41. }
  42. &__dropdown {
  43. display: inline-flex;
  44. align-items: center;
  45. justify-content: center;
  46. width: 100rpx;
  47. &-box {
  48. position: absolute;
  49. top: 80rpx;
  50. left: 0;
  51. width: 100%;
  52. box-sizing: border-box;
  53. background-color: #fff;
  54. overflow: hidden;
  55. transition: all 0.3s;
  56. z-index: 99;
  57. }
  58. }
  59. &__line {
  60. height: 4rpx;
  61. width: 16px;
  62. position: absolute;
  63. bottom: 2rpx;
  64. border-radius: 20rpx;
  65. transition: all 0.5s;
  66. background-color: $cl-color-primary;
  67. }
  68. &__container {
  69. height: calc(100% - 80rpx);
  70. background-color: #fff;
  71. .cl-tab-pane {
  72. height: 100%;
  73. &__scroller {
  74. height: 100%;
  75. }
  76. }
  77. }
  78. &.is-sticky {
  79. .cl-tabs__header {
  80. position: sticky;
  81. z-index: 99;
  82. /* #ifdef H5 */
  83. top: 44px;
  84. /* #endif */
  85. /* #ifndef H5 */
  86. top: 0;
  87. /* #endif */
  88. }
  89. }
  90. &.is-content {
  91. height: 100%;
  92. }
  93. &.is-fill {
  94. .cl-tabs__bar-item {
  95. flex: 1;
  96. }
  97. }
  98. &.is-border {
  99. .cl-tabs__header {
  100. border-bottom: 1rpx solid #eee;
  101. }
  102. }
  103. &.is-dropdown {
  104. .cl-tabs__bar {
  105. width: calc(100% - 100rpx);
  106. }
  107. }
  108. }