kiner-tang(文辉)
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
33 additions and
9 deletions
components/drawer/style/index.ts
docs/react/migrate-less-variables.en-US.md
docs/react/migrate-less-variables.zh-CN.md
@ -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 下拉菜单 -->