|
| 1 | +import type { CSSObject } from '../../_util/cssinjs'; |
| 2 | + |
| 3 | +export const tabsCardStyle:{tabsCardGutter:string}={ |
| 4 | + tabsCardGutter: '2px' |
| 5 | +} |
| 6 | +export const genTabscardStyle = (token): CSSObject => { |
| 7 | + const { componentCls } = token; |
| 8 | + |
| 9 | + return { |
| 10 | + [` ${componentCls}-nav, |
| 11 | + div > ${componentCls}-nav `]: { |
| 12 | + [`${componentCls}-tab `]: { |
| 13 | + margin: 0, |
| 14 | + background: `${token.colorFillAlter}`, |
| 15 | + padding: `${token.paddingXS}px ${token.padding}px`, |
| 16 | + border:`${token.lineWidth}px ${token.colorBorder} ${token.lineType} `, |
| 17 | + transition: `all ${token.motionDurationSlow} ${token.motionEaseInOut} `, |
| 18 | + |
| 19 | + [`&-active `]: { |
| 20 | + color: ` ${token.colorInfoActive}`, |
| 21 | + background: `${token.colorBgContainer}`, |
| 22 | + }, |
| 23 | + }, |
| 24 | + |
| 25 | + [`${componentCls}-ink-bar`]: { |
| 26 | + visibility: `hidden`, |
| 27 | + }, |
| 28 | + }, |
| 29 | + |
| 30 | + // ========================== Top & Bottom ========================== |
| 31 | + [`&${componentCls}-top, |
| 32 | + &${componentCls}-bottom`]: { |
| 33 | + [`${componentCls}-nav, |
| 34 | + div > ${componentCls}-nav `]: { |
| 35 | + [` ${componentCls}-tab + ${componentCls}-tab `]: { |
| 36 | + marginLeft: `${tabsCardStyle.tabsCardGutter} `, |
| 37 | + }, |
| 38 | + }, |
| 39 | + }, |
| 40 | + |
| 41 | + [`&${componentCls}-top `]: { |
| 42 | + [`${componentCls}-nav, |
| 43 | + div > ${componentCls}-nav `]: { |
| 44 | + [`${componentCls}-tab `]: { |
| 45 | + borderRadius: ` ${token.radiusBase}px ${token.radiusBase}px 0 0`, |
| 46 | + [`&-active `]: { |
| 47 | + borderBottomColor: `${token.colorBgContainer}`, |
| 48 | + }, |
| 49 | + }, |
| 50 | + }, |
| 51 | + }, |
| 52 | + [`&${componentCls}-bottom`]: { |
| 53 | + [`${componentCls}-nav, |
| 54 | + div > ${componentCls}-nav`]: { |
| 55 | + [` ${componentCls}-tab `]: { |
| 56 | + borderRadius: `0 0 ${token.radiusBase}px ${token.radiusBase}px`, |
| 57 | + |
| 58 | + [` &-active `]: { |
| 59 | + borderTopColor: `${token.colorBgContainer}`, |
| 60 | + }, |
| 61 | + }, |
| 62 | + }, |
| 63 | + }, |
| 64 | + |
| 65 | + // ========================== Left & Right ========================== |
| 66 | + [`&${componentCls}-left, |
| 67 | + &${componentCls}-right`]: { |
| 68 | + [` ${componentCls}-nav, |
| 69 | + div > ${componentCls}-nav `]: { |
| 70 | + [` ${componentCls}-tab + ${componentCls}-tab`]: { |
| 71 | + marginTop: `${tabsCardStyle.tabsCardGutter}`, |
| 72 | + }, |
| 73 | + }, |
| 74 | + }, |
| 75 | + |
| 76 | + [`&${componentCls}-left`]: { |
| 77 | + [` > ${componentCls}-nav, |
| 78 | + > div > ${componentCls}-nav`]: { |
| 79 | + [` ${componentCls}-tab`]: { |
| 80 | + borderRadius: `${token.radiusBase}px 0 0 ${token.radiusBase}px`, |
| 81 | + |
| 82 | + [` &-active`]: { |
| 83 | + borderRightColor: `${token.colorBgContainer}`, |
| 84 | + }, |
| 85 | + }, |
| 86 | + }, |
| 87 | + }, |
| 88 | + [` &${componentCls}-right `]: { |
| 89 | + [` ${componentCls}-nav, |
| 90 | + div > ${componentCls}-nav `]: { |
| 91 | + [` ${componentCls}-tab `]: { |
| 92 | + borderRadius: `0 ${token.radiusBase}px ${token.radiusBase}px 0`, |
| 93 | + |
| 94 | + [` &-active `]: { |
| 95 | + borderLeftColor:`${token.colorBgContainer}`, |
| 96 | + }, |
| 97 | + }, |
| 98 | + }, |
| 99 | + }, |
| 100 | + }; |
| 101 | +}; |
0 commit comments