Skip to content

Commit

Permalink
style: fix Drawer close icon style
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Mar 16, 2024
1 parent f7bab92 commit c7e9c80
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 26 deletions.
15 changes: 5 additions & 10 deletions components/drawer/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ export interface ComponentToken {
* @descEN Horizontal padding of footer
*/
footerPaddingInline: number;
/** @internal */
closeBtnHoverBg: string;
/** @internal */
closeBtnActiveBg: string;
}

export interface DrawerToken extends FullToken<'Drawer'> {}
Expand All @@ -48,8 +44,8 @@ const genDrawerStyle: GenerateStyle<DrawerToken> = (token) => {
marginXXS,
colorIcon,
colorIconHover,
closeBtnHoverBg,
closeBtnActiveBg,
colorBgTextHover,
colorBgTextActive,
controlHeight,
colorText,
fontWeightStrong,
Expand Down Expand Up @@ -180,6 +176,7 @@ const genDrawerStyle: GenerateStyle<DrawerToken> = (token) => {
height: controlHeight,
borderRadius: borderRadiusSM,
justifyContent: 'center',
alignItems: 'center',
marginInlineEnd: marginXXS,
color: colorIcon,
fontWeight: fontWeightStrong,
Expand All @@ -197,11 +194,11 @@ const genDrawerStyle: GenerateStyle<DrawerToken> = (token) => {
textRendering: 'auto',

'&:hover': {
backgroundColor: closeBtnHoverBg,
backgroundColor: colorBgTextHover,
},

'&:active': {
backgroundColor: closeBtnActiveBg,
backgroundColor: colorBgTextActive,
},

'&:focus, &:hover': {
Expand Down Expand Up @@ -247,8 +244,6 @@ export const prepareComponentToken: GetDefaultToken<'Drawer'> = (token) => ({
zIndexPopup: token.zIndexPopupBase,
footerPaddingBlock: token.paddingXS,
footerPaddingInline: token.padding,
closeBtnHoverBg: token.wireframe ? 'transparent' : token.colorFillContent,
closeBtnActiveBg: token.wireframe ? 'transparent' : token.colorFillContentHover,
});

// ============================== Export ==============================
Expand Down
10 changes: 2 additions & 8 deletions components/modal/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ export interface ComponentToken {
*/
footerBg: string;

/** @internal */
closeBtnHoverBg: string;
/** @internal */
closeBtnActiveBg: string;
/** @internal */
contentPadding: number | string;
/** @internal */
Expand Down Expand Up @@ -249,12 +245,12 @@ const genModalStyle: GenerateStyle<ModalToken> = (token) => {

'&:hover': {
color: token.modalCloseIconHoverColor,
backgroundColor: token.closeBtnHoverBg,
backgroundColor: token.colorBgTextHover,
textDecoration: 'none',
},

'&:active': {
backgroundColor: token.closeBtnActiveBg,
backgroundColor: token.colorBgTextActive,
},

...genFocusStyle(token),
Expand Down Expand Up @@ -367,8 +363,6 @@ export const prepareComponentToken = (token: GlobalToken) => ({
titleColor: token.colorTextHeading,

// internal
closeBtnHoverBg: token.wireframe ? 'transparent' : token.colorFillContent,
closeBtnActiveBg: token.wireframe ? 'transparent' : token.colorFillContentHover,
contentPadding: token.wireframe
? 0
: `${unit(token.paddingMD)} ${unit(token.paddingContentHorizontalLG)}`,
Expand Down
5 changes: 1 addition & 4 deletions components/notification/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ export interface ComponentToken {
* @descEN Width of Notification
*/
width: number;
/** @internal */
closeBtnHoverBg: string;
}

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

'&:hover': {
color: token.colorIconHover,
backgroundColor: token.closeBtnHoverBg,
backgroundColor: token.colorBgTextHover,
},
},

Expand Down Expand Up @@ -262,7 +260,6 @@ const genNotificationStyle: GenerateStyle<NotificationToken> = (token) => {
export const prepareComponentToken = (token: AliasToken) => ({
zIndexPopup: token.zIndexPopupBase + CONTAINER_MAX_OFFSET + 50,
width: 384,
closeBtnHoverBg: token.wireframe ? 'transparent' : token.colorFillContent,
});

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

'&:hover': {
color: token.colorIconHover,
backgroundColor: token.closeBtnHoverBg,
backgroundColor: token.colorBgTextHover,
},
},

Expand Down Expand Up @@ -271,7 +269,6 @@ 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 c7e9c80

Please sign in to comment.