index-pure.less 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @import './size';
  4. @import './rtl';
  5. @import './position';
  6. @import './dropdown';
  7. @import './card';
  8. @tab-prefix-cls: ~'@{ant-prefix}-tabs';
  9. .@{tab-prefix-cls} {
  10. .reset-component();
  11. display: flex;
  12. overflow: hidden;
  13. // ========================== Navigation ==========================
  14. > .@{tab-prefix-cls}-nav,
  15. > div > .@{tab-prefix-cls}-nav {
  16. position: relative;
  17. display: flex;
  18. flex: none;
  19. align-items: center;
  20. .@{tab-prefix-cls}-nav-wrap {
  21. position: relative;
  22. display: inline-block;
  23. display: flex;
  24. flex: auto;
  25. align-self: stretch;
  26. overflow: hidden;
  27. white-space: nowrap;
  28. transform: translate(0); // Fix chrome render bug
  29. // >>>>> Ping shadow
  30. &::before,
  31. &::after {
  32. position: absolute;
  33. z-index: 1;
  34. opacity: 0;
  35. transition: opacity @animation-duration-slow;
  36. content: '';
  37. pointer-events: none;
  38. }
  39. }
  40. .@{tab-prefix-cls}-nav-list {
  41. position: relative;
  42. display: flex;
  43. transition: transform @animation-duration-slow;
  44. }
  45. // >>>>>>>> Operations
  46. .@{tab-prefix-cls}-nav-operations {
  47. display: flex;
  48. align-self: stretch;
  49. &-hidden {
  50. position: absolute;
  51. visibility: hidden;
  52. pointer-events: none;
  53. }
  54. }
  55. .@{tab-prefix-cls}-nav-more {
  56. position: relative;
  57. padding: @tabs-card-horizontal-padding;
  58. background: transparent;
  59. border: 0;
  60. &::after {
  61. position: absolute;
  62. right: 0;
  63. bottom: 0;
  64. left: 0;
  65. height: 5px;
  66. transform: translateY(100%);
  67. content: '';
  68. }
  69. }
  70. .@{tab-prefix-cls}-nav-add {
  71. min-width: @tabs-card-height;
  72. margin-left: @tabs-card-gutter;
  73. padding: 0 @padding-xs;
  74. background: @tabs-card-head-background;
  75. border: @border-width-base @border-style-base @border-color-split;
  76. border-radius: @border-radius-base @border-radius-base 0 0;
  77. outline: none;
  78. cursor: pointer;
  79. transition: all @animation-duration-slow @ease-in-out;
  80. &:hover {
  81. color: @tabs-hover-color;
  82. }
  83. &:active,
  84. &:focus {
  85. color: @tabs-active-color;
  86. }
  87. }
  88. }
  89. &-extra-content {
  90. flex: none;
  91. }
  92. &-centered {
  93. > .@{tab-prefix-cls}-nav,
  94. > div > .@{tab-prefix-cls}-nav {
  95. .@{tab-prefix-cls}-nav-wrap {
  96. &:not([class*='@{tab-prefix-cls}-nav-wrap-ping']) {
  97. justify-content: center;
  98. }
  99. }
  100. }
  101. }
  102. // ============================ InkBar ============================
  103. &-ink-bar {
  104. position: absolute;
  105. background: @tabs-ink-bar-color;
  106. pointer-events: none;
  107. }
  108. // ============================= Tabs =============================
  109. &-tab {
  110. position: relative;
  111. display: inline-flex;
  112. align-items: center;
  113. padding: @tabs-horizontal-padding;
  114. font-size: @tabs-title-font-size;
  115. background: transparent;
  116. border: 0;
  117. outline: none;
  118. cursor: pointer;
  119. &-btn,
  120. &-remove {
  121. &:focus,
  122. &:active {
  123. color: @tabs-active-color;
  124. }
  125. }
  126. &-btn {
  127. outline: none;
  128. transition: all 0.3s;
  129. }
  130. &-remove {
  131. flex: none;
  132. margin-right: -@margin-xss;
  133. margin-left: @margin-xs;
  134. color: @text-color-secondary;
  135. font-size: @font-size-sm;
  136. background: transparent;
  137. border: none;
  138. outline: none;
  139. cursor: pointer;
  140. transition: all @animation-duration-slow;
  141. &:hover {
  142. color: @heading-color;
  143. }
  144. }
  145. &:hover {
  146. color: @tabs-hover-color;
  147. }
  148. &&-active &-btn {
  149. color: @tabs-highlight-color;
  150. text-shadow: 0 0 0.25px currentcolor;
  151. }
  152. &&-disabled {
  153. color: @disabled-color;
  154. cursor: not-allowed;
  155. }
  156. &&-disabled &-btn,
  157. &&-disabled &-remove {
  158. &:focus,
  159. &:active {
  160. color: @disabled-color;
  161. }
  162. }
  163. & &-remove .@{iconfont-css-prefix} {
  164. margin: 0;
  165. }
  166. .@{iconfont-css-prefix} {
  167. margin-right: @margin-sm;
  168. }
  169. }
  170. &-tab + &-tab {
  171. margin: @tabs-horizontal-margin;
  172. }
  173. // =========================== TabPanes ===========================
  174. &-content {
  175. &-holder {
  176. flex: auto;
  177. min-width: 0;
  178. min-height: 0;
  179. }
  180. display: flex;
  181. width: 100%;
  182. &-animated {
  183. transition: margin @animation-duration-slow;
  184. }
  185. }
  186. &-tabpane {
  187. flex: none;
  188. width: 100%;
  189. outline: none;
  190. }
  191. }