From 4236abb28c90713302704255f297dccdd6ce3dbe Mon Sep 17 00:00:00 2001 From: MadCcc Date: Thu, 16 Nov 2023 15:34:24 +0800 Subject: [PATCH] refactor: wireframe token for Notification and Tour (#45915) --- components/notification/style/index.ts | 5 ++++- components/tour/style/index.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/components/notification/style/index.ts b/components/notification/style/index.ts index 23798828c6..556d54a6c8 100644 --- a/components/notification/style/index.ts +++ b/components/notification/style/index.ts @@ -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 = (token) => { export const prepareComponentToken = (token: AliasToken) => ({ zIndexPopup: token.zIndexPopupBase + 50, width: 384, + closeBtnHoverBg: token.wireframe ? 'transparent' : token.colorFillContent, }); export const prepareNotificationToken: ( diff --git a/components/tour/style/index.ts b/components/tour/style/index.ts index 52ca8afc2f..c3f19071fe 100644 --- a/components/tour/style/index.ts +++ b/components/tour/style/index.ts @@ -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 = (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(),