position.less 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. @import '../../style/themes/index';
  2. @tab-prefix-cls: ~'@{ant-prefix}-tabs';
  3. .@{tab-prefix-cls} {
  4. // ========================== Top & Bottom ==========================
  5. &-top,
  6. &-bottom {
  7. flex-direction: column;
  8. > .@{tab-prefix-cls}-nav,
  9. > div > .@{tab-prefix-cls}-nav {
  10. margin: @tabs-bar-margin;
  11. &::before {
  12. position: absolute;
  13. right: 0;
  14. left: 0;
  15. border-bottom: @border-width-base @border-style-base @border-color-split;
  16. content: '';
  17. }
  18. .@{tab-prefix-cls}-ink-bar {
  19. height: 2px;
  20. &-animated {
  21. transition: width @animation-duration-slow, left @animation-duration-slow,
  22. right @animation-duration-slow;
  23. }
  24. }
  25. .@{tab-prefix-cls}-nav-wrap {
  26. &::before,
  27. &::after {
  28. top: 0;
  29. bottom: 0;
  30. width: 30px;
  31. }
  32. &::before {
  33. left: 0;
  34. box-shadow: inset 10px 0 8px -8px fade(@shadow-color, 8%);
  35. }
  36. &::after {
  37. right: 0;
  38. box-shadow: inset -10px 0 8px -8px fade(@shadow-color, 8%);
  39. }
  40. &.@{tab-prefix-cls}-nav-wrap-ping-left::before {
  41. opacity: 1;
  42. }
  43. &.@{tab-prefix-cls}-nav-wrap-ping-right::after {
  44. opacity: 1;
  45. }
  46. }
  47. }
  48. }
  49. &-top {
  50. > .@{tab-prefix-cls}-nav,
  51. > div > .@{tab-prefix-cls}-nav {
  52. &::before {
  53. bottom: 0;
  54. }
  55. .@{tab-prefix-cls}-ink-bar {
  56. bottom: 0;
  57. }
  58. }
  59. }
  60. &-bottom {
  61. > .@{tab-prefix-cls}-nav,
  62. > div > .@{tab-prefix-cls}-nav {
  63. order: 1;
  64. margin-top: @margin-md;
  65. margin-bottom: 0;
  66. &::before {
  67. top: 0;
  68. }
  69. .@{tab-prefix-cls}-ink-bar {
  70. top: 0;
  71. }
  72. }
  73. > .@{tab-prefix-cls}-content-holder,
  74. > div > .@{tab-prefix-cls}-content-holder {
  75. order: 0;
  76. }
  77. }
  78. // ========================== Left & Right ==========================
  79. &-left,
  80. &-right {
  81. > .@{tab-prefix-cls}-nav,
  82. > div > .@{tab-prefix-cls}-nav {
  83. flex-direction: column;
  84. min-width: 50px;
  85. // >>>>>>>>>>> Tab
  86. .@{tab-prefix-cls}-tab {
  87. padding: @tabs-vertical-padding;
  88. text-align: center;
  89. }
  90. .@{tab-prefix-cls}-tab + .@{tab-prefix-cls}-tab {
  91. margin: @tabs-vertical-margin;
  92. }
  93. // >>>>>>>>>>> Nav
  94. .@{tab-prefix-cls}-nav-wrap {
  95. flex-direction: column;
  96. &::before,
  97. &::after {
  98. right: 0;
  99. left: 0;
  100. height: 30px;
  101. }
  102. &::before {
  103. top: 0;
  104. box-shadow: inset 0 10px 8px -8px fade(@shadow-color, 8%);
  105. }
  106. &::after {
  107. bottom: 0;
  108. box-shadow: inset 0 -10px 8px -8px fade(@shadow-color, 8%);
  109. }
  110. &.@{tab-prefix-cls}-nav-wrap-ping-top::before {
  111. opacity: 1;
  112. }
  113. &.@{tab-prefix-cls}-nav-wrap-ping-bottom::after {
  114. opacity: 1;
  115. }
  116. }
  117. // >>>>>>>>>>> Ink Bar
  118. .@{tab-prefix-cls}-ink-bar {
  119. width: 2px;
  120. &-animated {
  121. transition: height @animation-duration-slow, top @animation-duration-slow;
  122. }
  123. }
  124. .@{tab-prefix-cls}-nav-list,
  125. .@{tab-prefix-cls}-nav-operations {
  126. flex: 1 0 auto; // fix safari scroll problem
  127. flex-direction: column;
  128. }
  129. }
  130. }
  131. &-left {
  132. > .@{tab-prefix-cls}-nav,
  133. > div > .@{tab-prefix-cls}-nav {
  134. .@{tab-prefix-cls}-ink-bar {
  135. right: 0;
  136. }
  137. }
  138. > .@{tab-prefix-cls}-content-holder,
  139. > div > .@{tab-prefix-cls}-content-holder {
  140. margin-left: -@border-width-base;
  141. border-left: @border-width-base @border-style-base @border-color-split;
  142. > .@{tab-prefix-cls}-content > .@{tab-prefix-cls}-tabpane {
  143. padding-left: @padding-lg;
  144. }
  145. }
  146. }
  147. &-right {
  148. > .@{tab-prefix-cls}-nav,
  149. > div > .@{tab-prefix-cls}-nav {
  150. order: 1;
  151. .@{tab-prefix-cls}-ink-bar {
  152. left: 0;
  153. }
  154. }
  155. > .@{tab-prefix-cls}-content-holder,
  156. > div > .@{tab-prefix-cls}-content-holder {
  157. order: 0;
  158. margin-right: -@border-width-base;
  159. border-right: @border-width-base @border-style-base @border-color-split;
  160. > .@{tab-prefix-cls}-content > .@{tab-prefix-cls}-tabpane {
  161. padding-right: @padding-lg;
  162. }
  163. }
  164. }
  165. }