mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
feat: migrate less to token for Drawer (#42084)
This commit is contained in:
parent
70c76b737f
commit
5e4e9970dc
@ -4,13 +4,12 @@ import genMotionStyle from './motion';
|
||||
|
||||
export interface ComponentToken {
|
||||
zIndexPopup: number;
|
||||
}
|
||||
|
||||
export interface DrawerToken extends FullToken<'Drawer'> {
|
||||
drawerFooterPaddingVertical: number;
|
||||
drawerFooterPaddingHorizontal: number;
|
||||
}
|
||||
|
||||
export interface DrawerToken extends FullToken<'Drawer'> {}
|
||||
|
||||
// =============================== Base ===============================
|
||||
const genDrawerStyle: GenerateStyle<DrawerToken> = (token: DrawerToken) => {
|
||||
const {
|
||||
@ -217,14 +216,13 @@ const genDrawerStyle: GenerateStyle<DrawerToken> = (token: DrawerToken) => {
|
||||
export default genComponentStyleHook(
|
||||
'Drawer',
|
||||
(token) => {
|
||||
const drawerToken = mergeToken<DrawerToken>(token, {
|
||||
drawerFooterPaddingVertical: token.paddingXS,
|
||||
drawerFooterPaddingHorizontal: token.padding,
|
||||
});
|
||||
const drawerToken = mergeToken<DrawerToken>(token, {});
|
||||
|
||||
return [genDrawerStyle(drawerToken), genMotionStyle(drawerToken)];
|
||||
},
|
||||
(token) => ({
|
||||
zIndexPopup: token.zIndexPopupBase,
|
||||
drawerFooterPaddingVertical: token.paddingXS,
|
||||
drawerFooterPaddingHorizontal: token.padding,
|
||||
}),
|
||||
);
|
||||
|
@ -39,7 +39,20 @@ This document contains the correspondence between all the less variables related
|
||||
|
||||
<!-- ### Divider -->
|
||||
|
||||
<!-- ### Drawer -->
|
||||
|
||||
## Drawer
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
| Less variables | Component Token | Note |
|
||||
| --- | --- | --- |
|
||||
| `@drawer-bg` | `colorBgElevated` | - |
|
||||
| `@drawer-header-padding` | `padding`、`paddingLG` | `${padding}px ${paddingLG}px` |
|
||||
| `@drawer-title-font-size` | `fontSizeLG` | - |
|
||||
| `@drawer-title-line-height` | `lineHeightLG` | - |
|
||||
| `@drawer-body-padding` | `paddingLG` | - |
|
||||
| `@drawer-footer-padding-vertical` | `drawerFooterPaddingVertical` | `drawerFooterPaddingVertical` is a number without units, `@drawer-footer-padding-vertical` with units |
|
||||
| `@drawer-footer-padding-horizontal` | `drawerFooterPaddingHorizontal` | `drawerFooterPaddingHorizontal` is a number without units, `@drawer-footer-padding-horizontal` with units |
|
||||
|
||||
|
||||
<!-- ### Dropdown -->
|
||||
|
||||
|
@ -39,7 +39,20 @@ title: Less 变量迁移 Design Token
|
||||
|
||||
<!-- ### Divider 分割线 -->
|
||||
|
||||
<!-- ### Drawer 抽屉 -->
|
||||
|
||||
## Drawer 抽屉
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
| Less 变量 | Component Token | 备注 |
|
||||
| --- | --- | --- |
|
||||
| `@drawer-bg` | `colorBgElevated` | - |
|
||||
| `@drawer-header-padding` | `padding`、`paddingLG` | `${padding}px ${paddingLG}px` |
|
||||
| `@drawer-title-font-size` | `fontSizeLG` | - |
|
||||
| `@drawer-title-line-height` | `lineHeightLG` | - |
|
||||
| `@drawer-body-padding` | `paddingLG` | - |
|
||||
| `@drawer-footer-padding-vertical` | `drawerFooterPaddingVertical` | `drawerFooterPaddingVertical` 为数字,不带单位,`@drawer-footer-padding-vertical` 带单位 |
|
||||
| `@drawer-footer-padding-horizontal` | `drawerFooterPaddingHorizontal` | `drawerFooterPaddingHorizontal` 为数字,不带单位,`@drawer-footer-padding-horizontal` 带单位 |
|
||||
|
||||
|
||||
<!-- ### Dropdown 下拉菜单 -->
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user