@ant-design/x
Version:
Craft AI-driven interfaces effortlessly
71 lines (69 loc) • 2.09 kB
JavaScript
import { mergeToken } from '@ant-design/cssinjs-utils';
import { genStyleHooks } from "../../theme/genStyleUtils";
// biome-ignore lint/suspicious/noEmptyInterface: ComponentToken need to be empty by default
const genActionsStyle = token => {
const {
componentCls,
calc
} = token;
return {
[componentCls]: {
[`&${componentCls}-rtl`]: {
direction: 'rtl'
},
[`${componentCls}-list`]: {
display: 'inline-flex',
flexDirection: 'row',
gap: token.paddingXS,
color: token.colorTextDescription,
'&-item, &-sub-item': {
cursor: 'pointer',
padding: token.paddingXXS,
borderRadius: token.borderRadius,
height: token.controlHeightSM,
width: token.controlHeightSM,
boxSizing: 'border-box',
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
'&-icon': {
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: token.fontSize,
width: '100%',
height: '100%'
},
'&:hover': {
background: token.colorBgTextHover
}
}
},
'& .border': {
padding: `${token.paddingXS} ${token.paddingSM}`,
gap: token.paddingSM,
borderRadius: calc(token.borderRadiusLG).mul(1.5).equal(),
backgroundColor: token.colorBorderSecondary,
color: token.colorTextSecondary,
[`${componentCls}-list-item, ${componentCls}-list-sub-item`]: {
padding: 0,
lineHeight: token.lineHeight,
'&-icon': {
fontSize: token.fontSizeLG
},
'&:hover': {
opacity: 0.8
}
}
},
'& .block': {
display: 'flex'
}
}
};
};
export const prepareComponentToken = () => ({});
export default genStyleHooks('Actions', token => {
const compToken = mergeToken(token, {});
return [genActionsStyle(compToken)];
}, prepareComponentToken);