ant-design/components/cascader/style/panel.ts
红果汁 038323441c
feat: Cascader support cssVar (#45858)
* feat: cascader support cssvar

* fix: replace rootCls

* fix: add rootCls

* fix: panel add rootCls

* fix: add cascaderRootCls
2023-11-15 16:12:57 +08:00

42 lines
1.2 KiB
TypeScript

import { unit, type CSSObject } from '@ant-design/cssinjs';
import { prepareComponentToken, type CascaderToken } from '.';
import { genComponentStyleHook, type GenerateStyle } from '../../theme/internal';
import getColumnsStyle from './columns';
// ============================== Panel ===============================
const genPanelStyle: GenerateStyle<CascaderToken> = (token: CascaderToken): CSSObject => {
const { componentCls } = token;
return {
[`${componentCls}-panel`]: [
getColumnsStyle(token),
{
display: 'inline-flex',
border: `${unit(token.lineWidth)} ${token.lineType} ${token.colorSplit}`,
borderRadius: token.borderRadiusLG,
overflowX: 'auto',
maxWidth: '100%',
[`${componentCls}-menus`]: {
alignItems: 'stretch',
},
[`${componentCls}-menu`]: {
height: 'auto',
},
'&-empty': {
padding: token.paddingXXS,
},
},
],
};
};
// ============================== Export ==============================
export default genComponentStyleHook(
['Cascader', 'Panel'],
(token) => genPanelStyle(token),
prepareComponentToken,
);