mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-02 15:59:38 +08:00
9f88c1238a
* feat: token update * chore: update test * chore: lint * chore: code clean * test: update test case * feat: radius token update * fix: form size * chore: fix steps style * chore: code clean * chore: update test case
54 lines
1.2 KiB
TypeScript
54 lines
1.2 KiB
TypeScript
/* eslint-disable import/prefer-default-export */
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
import type { DerivativeToken } from '../theme';
|
|
|
|
function compactItemVerticalBorder(token: DerivativeToken): CSSObject {
|
|
return {
|
|
// border collapse
|
|
'&-item:not(&-last-item)': {
|
|
marginBottom: -token.lineWidth,
|
|
},
|
|
|
|
'&-item': {
|
|
'&:hover,&:focus,&:active': {
|
|
zIndex: 2,
|
|
},
|
|
|
|
'&[disabled]': {
|
|
zIndex: 0,
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
function compactItemBorderVerticalRadius(prefixCls: string): CSSObject {
|
|
return {
|
|
'&-item:not(&-first-item):not(&-last-item)': {
|
|
borderRadius: 0,
|
|
},
|
|
|
|
'&-item&-first-item': {
|
|
[`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
|
|
borderEndEndRadius: 0,
|
|
borderEndStartRadius: 0,
|
|
},
|
|
},
|
|
|
|
'&-item&-last-item': {
|
|
[`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
|
|
borderStartStartRadius: 0,
|
|
borderStartEndRadius: 0,
|
|
},
|
|
},
|
|
};
|
|
}
|
|
|
|
export function genCompactItemVerticalStyle(token: DerivativeToken, prefixCls: string): CSSObject {
|
|
return {
|
|
'&-compact-vertical': {
|
|
...compactItemVerticalBorder(token),
|
|
...compactItemBorderVerticalRadius(prefixCls),
|
|
},
|
|
};
|
|
}
|