Skip to content

Commit

Permalink
refactor: wireframe token for Notification and Tour (ant-design#45915)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadCcc authored Nov 16, 2023
1 parent b953199 commit 4236abb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion components/notification/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export interface ComponentToken {
* @descEN Width of Notification
*/
width: number;
/** @internal */
closeBtnHoverBg: string;
}

export interface NotificationToken extends FullToken<'Notification'> {
Expand Down Expand Up @@ -147,7 +149,7 @@ export const genNoticeStyle = (token: NotificationToken): CSSObject => {

'&:hover': {
color: token.colorIconHover,
backgroundColor: token.wireframe ? 'transparent' : token.colorFillContent,
backgroundColor: token.closeBtnHoverBg,
},
},

Expand Down Expand Up @@ -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: (
Expand Down
5 changes: 4 additions & 1 deletion components/tour/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'> {
Expand Down Expand Up @@ -127,7 +129,7 @@ const genBaseStyle: GenerateStyle<TourToken> = (token) => {

'&:hover': {
color: token.colorIconHover,
backgroundColor: token.wireframe ? 'transparent' : token.colorFillContent,
backgroundColor: token.closeBtnHoverBg,
},
},

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

0 comments on commit 4236abb

Please sign in to comment.