You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.4 KiB
57 lines
1.4 KiB
2 years ago
|
/* eslint-disable import/prefer-default-export */
|
||
2 years ago
|
import type { CSSInterpolation, CSSObject } from '@ant-design/cssinjs';
|
||
|
import type { DerivativeToken, FullToken } from '../theme/internal';
|
||
|
import type { OverrideComponent } from '../theme/util/genComponentStyleHook';
|
||
2 years ago
|
|
||
|
function compactItemVerticalBorder(token: DerivativeToken): CSSObject {
|
||
|
return {
|
||
|
// border collapse
|
||
|
'&-item:not(&-last-item)': {
|
||
2 years ago
|
marginBottom: -token.lineWidth,
|
||
2 years ago
|
},
|
||
|
|
||
|
'&-item': {
|
||
|
'&:hover,&:focus,&:active': {
|
||
|
zIndex: 2,
|
||
|
},
|
||
|
|
||
|
'&[disabled]': {
|
||
|
zIndex: 0,
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function compactItemBorderVerticalRadius(prefixCls: string): CSSObject {
|
||
|
return {
|
||
|
'&-item:not(&-first-item):not(&-last-item)': {
|
||
|
borderRadius: 0,
|
||
|
},
|
||
|
|
||
2 years ago
|
'&-item&-first-item:not(&-last-item)': {
|
||
2 years ago
|
[`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
|
||
|
borderEndEndRadius: 0,
|
||
|
borderEndStartRadius: 0,
|
||
|
},
|
||
|
},
|
||
|
|
||
2 years ago
|
'&-item&-last-item:not(&-first-item)': {
|
||
2 years ago
|
[`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
|
||
|
borderStartStartRadius: 0,
|
||
|
borderStartEndRadius: 0,
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
}
|
||
|
|
||
2 years ago
|
export function genCompactItemVerticalStyle<T extends OverrideComponent>(
|
||
|
token: FullToken<T>,
|
||
|
): CSSInterpolation {
|
||
2 years ago
|
return {
|
||
2 years ago
|
[`${token.componentCls}-compact-vertical`]: {
|
||
2 years ago
|
...compactItemVerticalBorder(token),
|
||
2 years ago
|
...compactItemBorderVerticalRadius(token.componentCls),
|
||
2 years ago
|
},
|
||
|
};
|
||
|
}
|