refactor: wireframe token for Notification and Tour (#45915)

This commit is contained in:
MadCcc 2023-11-16 15:34:24 +08:00 committed by GitHub
parent b9531997a8
commit 4236abb28c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -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: (

View File

@ -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(),