Skip to content

Commit

Permalink
style: add focus style
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Mar 16, 2024
1 parent c7e9c80 commit b0d6781
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
9 changes: 4 additions & 5 deletions components/drawer/style/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { unit } from '@ant-design/cssinjs';

import { genFocusStyle } from '../../style';
import type { FullToken, GenerateStyle, GetDefaultToken } from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
import genMotionStyle from './motion';
Expand Down Expand Up @@ -188,23 +189,21 @@ const genDrawerStyle: GenerateStyle<DrawerToken> = (token) => {
textDecoration: 'none',
background: 'transparent',
border: 0,
outline: 0,
cursor: 'pointer',
transition: `all ${motionDurationMid}`,
textRendering: 'auto',

'&:hover': {
color: colorIconHover,
backgroundColor: colorBgTextHover,
textDecoration: 'none',
},

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

'&:focus, &:hover': {
color: colorIconHover,
textDecoration: 'none',
},
...genFocusStyle(token),
},

[`${componentCls}-title`]: {
Expand Down
8 changes: 7 additions & 1 deletion components/notification/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { CSSObject } from '@ant-design/cssinjs';
import { Keyframes, unit } from '@ant-design/cssinjs';

import { CONTAINER_MAX_OFFSET } from '../../_util/hooks/useZIndex';
import { resetComponent } from '../../style';
import { resetComponent, genFocusStyle } from '../../style';
import type { AliasToken, FullToken, GenerateStyle } from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
import genNotificationPlacementStyle from './placement';
Expand Down Expand Up @@ -151,6 +151,12 @@ export const genNoticeStyle = (token: NotificationToken): CSSObject => {
color: token.colorIconHover,
backgroundColor: token.colorBgTextHover,
},

'&:active': {
backgroundColor: token.colorBgTextHover,
},

...genFocusStyle(token),
},

[`${noticeCls}-btn`]: {
Expand Down
8 changes: 7 additions & 1 deletion components/tour/style/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TinyColor } from '@ctrl/tinycolor';

import { resetComponent } from '../../style';
import { resetComponent, genFocusStyle } from '../../style';
import type { ArrowOffsetToken } from '../../style/placementArrow';
import getArrowStyle, {
getArrowOffsetToken,
Expand Down Expand Up @@ -129,6 +129,12 @@ const genBaseStyle: GenerateStyle<TourToken> = (token) => {
color: token.colorIconHover,
backgroundColor: token.colorBgTextHover,
},

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

...genFocusStyle(token),
},

[`${componentCls}-cover`]: {
Expand Down

0 comments on commit b0d6781

Please sign in to comment.