index.less 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. @prefix-cls: ~'@{namespace}-multiple-tabs';
  2. html[data-theme='dark'] {
  3. .@{prefix-cls} {
  4. .ant-tabs-tab {
  5. border-bottom: 1px solid @border-color-base;
  6. }
  7. }
  8. }
  9. html[data-theme='light'] {
  10. .@{prefix-cls} {
  11. .ant-tabs-tab:not(.ant-tabs-tab-active) {
  12. border: 1px solid #d9d9d9 !important;
  13. }
  14. }
  15. }
  16. .@{prefix-cls} {
  17. z-index: 10;
  18. height: @multiple-height + 2;
  19. line-height: @multiple-height + 2;
  20. background-color: @component-background;
  21. border-bottom: 1px solid @border-color-base;
  22. .ant-tabs-small {
  23. height: @multiple-height;
  24. }
  25. .ant-tabs.ant-tabs-card {
  26. .ant-tabs-nav {
  27. padding-top: 2px;
  28. height: @multiple-height;
  29. margin: 0;
  30. background-color: @component-background;
  31. border: 0;
  32. box-shadow: none;
  33. .ant-tabs-nav-container {
  34. height: @multiple-height;
  35. padding-top: 2px;
  36. }
  37. .ant-tabs-tab {
  38. height: calc(@multiple-height - 2px);
  39. padding-right: 12px;
  40. line-height: calc(@multiple-height - 2px);
  41. color: @text-color-base;
  42. background-color: @component-background;
  43. transition: none;
  44. &:hover {
  45. .ant-tabs-tab-remove {
  46. opacity: 1;
  47. }
  48. }
  49. .ant-tabs-tab-remove {
  50. width: 8px;
  51. height: 28px;
  52. font-size: 12px;
  53. color: inherit;
  54. opacity: 0;
  55. transition: none;
  56. margin-left: 2px;
  57. margin-right: -4px;
  58. &:hover {
  59. svg {
  60. width: 0.8em;
  61. }
  62. }
  63. }
  64. // > div {
  65. // display: flex;
  66. // justify-content: center;
  67. // align-items: center;
  68. // }
  69. svg {
  70. fill: @text-color-base;
  71. }
  72. }
  73. .ant-tabs-tab:not(.ant-tabs-tab-active) {
  74. &:hover {
  75. color: @primary-color;
  76. }
  77. }
  78. .ant-tabs-tab-active {
  79. position: relative;
  80. padding-left: 18px;
  81. background: @primary-color;
  82. border: 0;
  83. transition: none;
  84. span {
  85. color: @white !important;
  86. }
  87. .ant-tabs-tab-remove {
  88. opacity: 1;
  89. }
  90. svg {
  91. width: 0.7em;
  92. fill: @white;
  93. }
  94. }
  95. }
  96. .ant-tabs-nav > div:nth-child(1) {
  97. padding: 0 6px;
  98. .ant-tabs-tab {
  99. margin-right: 3px !important;
  100. }
  101. }
  102. }
  103. .ant-tabs-tab:not(.ant-tabs-tab-active) {
  104. .anticon-close {
  105. font-size: 12px;
  106. svg {
  107. width: 0.6em;
  108. }
  109. }
  110. }
  111. .ant-dropdown-trigger {
  112. display: inline-flex;
  113. }
  114. &--hide-close {
  115. .ant-tabs-tab-remove {
  116. opacity: 0 !important;
  117. }
  118. }
  119. &-content {
  120. &__extra-quick,
  121. &__extra-redo,
  122. &__extra-fold {
  123. display: inline-block;
  124. width: 36px;
  125. height: @multiple-height;
  126. line-height: @multiple-height;
  127. color: @text-color-secondary;
  128. text-align: center;
  129. cursor: pointer;
  130. border-left: 1px solid @border-color-base;
  131. &:hover {
  132. color: @text-color-base;
  133. }
  134. span[role='img'] {
  135. transform: rotate(90deg);
  136. }
  137. }
  138. &__extra-redo {
  139. span[role='img'] {
  140. transform: rotate(0deg);
  141. }
  142. }
  143. &__info {
  144. display: inline-block;
  145. width: 100%;
  146. height: @multiple-height - 2;
  147. padding-left: 0;
  148. margin-left: -10px;
  149. font-size: 12px;
  150. cursor: pointer;
  151. user-select: none;
  152. }
  153. }
  154. }
  155. .ant-tabs-dropdown-menu {
  156. &-title-content {
  157. display: flex;
  158. align-items: center;
  159. .@{prefix-cls} {
  160. &-content__info {
  161. width: auto;
  162. margin-left: 0;
  163. line-height: 28px;
  164. }
  165. }
  166. }
  167. &-item-remove {
  168. margin-left: auto;
  169. }
  170. }
  171. .multiple-tabs__dropdown {
  172. .ant-dropdown-content {
  173. width: 172px;
  174. }
  175. }