card-style.less 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. @import '../../style/themes/index';
  2. @import '../../style/mixins/index';
  3. @tab-prefix-cls: ~'@{ant-prefix}-tabs';
  4. // card style
  5. .@{tab-prefix-cls} {
  6. &&-card &-card-bar &-ink-bar {
  7. visibility: hidden;
  8. }
  9. &&-card &-card-bar &-tab {
  10. margin: 0;
  11. margin-right: @tabs-card-gutter;
  12. padding: @tabs-card-horizontal-padding;
  13. line-height: 22px;
  14. background: @tabs-card-head-background;
  15. border: @border-width-base @border-style-base @border-color-split;
  16. border-radius: @border-radius-base @border-radius-base 0 0;
  17. transition: all 0.3s @ease-in-out;
  18. }
  19. &&-card &-card-bar &-tab-active {
  20. color: @tabs-card-active-color;
  21. background: @component-background;
  22. border-color: @border-color-split;
  23. border-bottom: @border-width-base solid @component-background;
  24. &::before {
  25. border-top: @tabs-card-tab-active-border-top;
  26. }
  27. }
  28. &&-small &-card-bar &-tab {
  29. padding: @tabs-card-horizontal-padding-sm;
  30. }
  31. &&-card &-card-bar &-tab-disabled {
  32. color: @disabled-color;
  33. }
  34. &&-card &-card-bar &-tab-inactive {
  35. padding: 0;
  36. }
  37. &&-card &-card-bar &-nav-wrap {
  38. margin-bottom: 0;
  39. }
  40. &&-card &-card-bar &-tab &-close-x {
  41. width: 16px;
  42. height: @font-size-base;
  43. margin-right: -5px;
  44. margin-left: 3px;
  45. overflow: hidden;
  46. color: @text-color-secondary;
  47. font-size: @font-size-sm;
  48. vertical-align: middle;
  49. transition: all 0.3s;
  50. &:hover {
  51. color: @heading-color;
  52. }
  53. }
  54. &&-card &-card-content > &-tabpane,
  55. &&-editable-card &-card-content > &-tabpane {
  56. transition: none !important;
  57. &-inactive {
  58. overflow: hidden;
  59. }
  60. }
  61. &&-card &-card-bar &-tab:hover .@{iconfont-css-prefix}-close {
  62. opacity: 1;
  63. }
  64. &-extra-content {
  65. // stylelint-disable-next-line
  66. line-height: @tabs-title-font-size * @line-height-base + extract(@tabs-horizontal-padding, 1) * 2;
  67. .@{tab-prefix-cls}-new-tab {
  68. position: relative;
  69. width: 20px;
  70. height: 20px;
  71. color: @text-color;
  72. font-size: 12px;
  73. line-height: 20px;
  74. text-align: center;
  75. border: @border-width-base @border-style-base @border-color-split;
  76. border-radius: @border-radius-base;
  77. cursor: pointer;
  78. transition: all 0.3s;
  79. &:hover {
  80. color: @tabs-card-active-color;
  81. border-color: @tabs-card-active-color;
  82. }
  83. svg {
  84. position: absolute;
  85. top: 0;
  86. right: 0;
  87. bottom: 0;
  88. left: 0;
  89. margin: auto;
  90. }
  91. }
  92. }
  93. // https://github.com/ant-design/ant-design/issues/17865
  94. &&-large &-extra-content {
  95. // stylelint-disable-next-line
  96. line-height: @tabs-title-font-size-lg * @line-height-base + extract(@tabs-horizontal-padding-lg, 1) * 2;
  97. }
  98. // https://github.com/ant-design/ant-design/issues/17865
  99. &&-small &-extra-content {
  100. // stylelint-disable-next-line
  101. line-height: @tabs-title-font-size-sm * @line-height-base + extract(@tabs-horizontal-padding-sm, 1) * 2;
  102. }
  103. // https://github.com/ant-design/ant-design/issues/17865
  104. &&-card &-extra-content {
  105. line-height: @tabs-card-height;
  106. }
  107. // https://github.com/ant-design/ant-design/issues/4669
  108. &-vertical&-card &-card-bar&-left-bar,
  109. &-vertical&-card &-card-bar&-right-bar {
  110. .@{tab-prefix-cls}-nav-container {
  111. height: 100%;
  112. }
  113. .@{tab-prefix-cls}-tab {
  114. margin-bottom: @margin-sm;
  115. border-bottom: @border-width-base @border-style-base @border-color-split;
  116. &-active {
  117. padding-bottom: 4px;
  118. }
  119. &:last-child {
  120. margin-bottom: @margin-sm;
  121. }
  122. }
  123. .@{tab-prefix-cls}-new-tab {
  124. width: 90%;
  125. }
  126. }
  127. &-vertical&-card&-left &-card-bar&-left-bar {
  128. .@{tab-prefix-cls}-nav-wrap {
  129. margin-right: 0;
  130. }
  131. .@{tab-prefix-cls}-tab {
  132. margin-right: 1px;
  133. border-right: 0;
  134. border-radius: @border-radius-base 0 0 @border-radius-base;
  135. &-active {
  136. margin-right: -1px;
  137. padding-right: @padding-md + 2px;
  138. }
  139. }
  140. }
  141. &-vertical&-card&-right &-card-bar&-right-bar {
  142. .@{tab-prefix-cls}-nav-wrap {
  143. margin-left: 0;
  144. }
  145. .@{tab-prefix-cls}-tab {
  146. margin-left: 1px;
  147. border-left: 0;
  148. border-radius: 0 @border-radius-base @border-radius-base 0;
  149. &-active {
  150. margin-left: -1px;
  151. padding-left: @padding-md + 2px;
  152. }
  153. }
  154. }
  155. // https://github.com/ant-design/ant-design/issues/9104
  156. & &-card-bar&-bottom-bar &-tab {
  157. height: auto;
  158. border-top-color: @border-color-split;
  159. border-bottom: @border-width-base @border-style-base @border-color-split;
  160. border-radius: 0 0 @border-radius-base @border-radius-base;
  161. }
  162. & &-card-bar&-bottom-bar &-tab-active {
  163. color: @primary-color;
  164. border-top-color: @component-background;
  165. }
  166. }
  167. @import './card-style.rtl.less';