mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 04:58:55 +08:00
refactor: wireframe token for Notification and Tour (#45915)
This commit is contained in:
parent
b9531997a8
commit
4236abb28c
@ -19,6 +19,8 @@ export interface ComponentToken {
|
||||
* @descEN Width of Notification
|
||||
*/
|
||||
width: number;
|
||||
/** @internal */
|
||||
closeBtnHoverBg: string;
|
||||
}
|
||||
|
||||
export interface NotificationToken extends FullToken<'Notification'> {
|
||||
@ -147,7 +149,7 @@ export const genNoticeStyle = (token: NotificationToken): CSSObject => {
|
||||
|
||||
'&:hover': {
|
||||
color: token.colorIconHover,
|
||||
backgroundColor: token.wireframe ? 'transparent' : token.colorFillContent,
|
||||
backgroundColor: token.closeBtnHoverBg,
|
||||
},
|
||||
},
|
||||
|
||||
@ -258,6 +260,7 @@ const genNotificationStyle: GenerateStyle<NotificationToken> = (token) => {
|
||||
export const prepareComponentToken = (token: AliasToken) => ({
|
||||
zIndexPopup: token.zIndexPopupBase + 50,
|
||||
width: 384,
|
||||
closeBtnHoverBg: token.wireframe ? 'transparent' : token.colorFillContent,
|
||||
});
|
||||
|
||||
export const prepareNotificationToken: (
|
||||
|
@ -33,6 +33,8 @@ export interface ComponentToken extends ArrowOffsetToken, ArrowToken {
|
||||
* @descEN Hover background color of next button in primary type
|
||||
*/
|
||||
primaryNextBtnHoverBg: string;
|
||||
/** @internal */
|
||||
closeBtnHoverBg: string;
|
||||
}
|
||||
|
||||
interface TourToken extends FullToken<'Tour'> {
|
||||
@ -127,7 +129,7 @@ const genBaseStyle: GenerateStyle<TourToken> = (token) => {
|
||||
|
||||
'&:hover': {
|
||||
color: token.colorIconHover,
|
||||
backgroundColor: token.wireframe ? 'transparent' : token.colorFillContent,
|
||||
backgroundColor: token.closeBtnHoverBg,
|
||||
},
|
||||
},
|
||||
|
||||
@ -269,6 +271,7 @@ export const prepareComponentToken: GetDefaultToken<'Tour'> = (token) => ({
|
||||
zIndexPopup: token.zIndexPopupBase + 70,
|
||||
closeBtnSize: token.fontSize * token.lineHeight,
|
||||
primaryPrevBtnBg: new TinyColor(token.colorTextLightSolid).setAlpha(0.15).toRgbString(),
|
||||
closeBtnHoverBg: token.wireframe ? 'transparent' : token.colorFillContent,
|
||||
primaryNextBtnHoverBg: new TinyColor(token.colorBgTextHover)
|
||||
.onBackground(token.colorWhite)
|
||||
.toRgbString(),
|
||||
|
Loading…
Reference in New Issue
Block a user