mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
feat: migrate less to token for Message (#42080)
This commit is contained in:
parent
629087833f
commit
18b7d1be5b
@ -10,11 +10,12 @@ export interface ComponentToken {
|
||||
// Component token here
|
||||
height: number;
|
||||
zIndexPopup: number;
|
||||
messageNoticeContentBg: string;
|
||||
messageNoticeContentPadding: string;
|
||||
}
|
||||
|
||||
interface MessageToken extends FullToken<'Message'> {
|
||||
// Custom token here
|
||||
messageNoticeContentPadding: string;
|
||||
}
|
||||
|
||||
const genMessageStyle: GenerateStyle<MessageToken> = (token) => {
|
||||
@ -175,15 +176,15 @@ export default genComponentStyleHook(
|
||||
'Message',
|
||||
(token) => {
|
||||
// Gen-style functions here
|
||||
const combinedToken = mergeToken<MessageToken>(token, {
|
||||
messageNoticeContentPadding: `${
|
||||
(token.controlHeightLG - token.fontSize * token.lineHeight) / 2
|
||||
}px ${token.paddingSM}px`,
|
||||
});
|
||||
const combinedToken = mergeToken<MessageToken>(token, {});
|
||||
return [genMessageStyle(combinedToken)];
|
||||
},
|
||||
(token) => ({
|
||||
height: 150,
|
||||
zIndexPopup: token.zIndexPopupBase + 10,
|
||||
messageNoticeContentBg: token.colorBgElevated,
|
||||
messageNoticeContentPadding: `${
|
||||
(token.controlHeightLG - token.fontSize * token.lineHeight) / 2
|
||||
}px ${token.paddingSM}px`,
|
||||
}),
|
||||
);
|
||||
|
@ -59,7 +59,14 @@ This document contains the correspondence between all the less variables related
|
||||
|
||||
<!-- ### Menu -->
|
||||
|
||||
<!-- ### Message -->
|
||||
## Message
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
| Less variables | Component Token | Note |
|
||||
| --- | --- | --- |
|
||||
| `@zindex-message` | `zIndexPopup` | - |
|
||||
| `@message-notice-content-padding` | `messageNoticeContentPadding` | - |
|
||||
| `@message-notice-content-bg` | `messageNoticeContentBg` | - |
|
||||
|
||||
## Modal
|
||||
|
||||
|
@ -59,7 +59,14 @@ title: Less 变量迁移 Design Token
|
||||
|
||||
<!-- ### Menu 导航菜单 -->
|
||||
|
||||
<!-- ### Message 全局提示 -->
|
||||
## Message 全局提示
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
| Less 变量 | Component Token | 备注 |
|
||||
| --- | --- | --- |
|
||||
| `@zindex-message` | `zIndexPopup` | - |
|
||||
| `@message-notice-content-padding` | `messageNoticeContentPadding` | - |
|
||||
| `@message-notice-content-bg` | `messageNoticeContentBg` | - |
|
||||
|
||||
### Modal 对话框
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user