mirror of
https://github.com/zhigang1992/react.git
synced 2026-05-16 08:29:44 +08:00
fix(link): fix hard-coded background color (#347)
This commit is contained in:
@@ -120,7 +120,7 @@ exports[`Link should render correctly 1`] = `
|
||||
}
|
||||
|
||||
.link:hover {
|
||||
background-color: #0076ff1a;
|
||||
background-color: rgba(0, 112, 243, 0.1);
|
||||
color: #3291ff;
|
||||
}
|
||||
</style></a></div>"
|
||||
|
||||
@@ -3,6 +3,7 @@ import withDefaults from '../utils/with-defaults'
|
||||
import useTheme from '../styles/use-theme'
|
||||
import useWarning from '../utils/use-warning'
|
||||
import LinkIcon from './icon'
|
||||
import { addColorAlpha } from '../utils/color'
|
||||
|
||||
export interface Props {
|
||||
href?: string
|
||||
@@ -65,7 +66,7 @@ const Link = React.forwardRef<HTMLAnchorElement, React.PropsWithChildren<LinkPro
|
||||
}
|
||||
|
||||
.link:hover {
|
||||
background-color: ${block ? '#0076ff1a' : 'unset'};
|
||||
background-color: ${block ? addColorAlpha(theme.palette.link, 0.1) : 'unset'};
|
||||
color: ${hoverColor};
|
||||
}
|
||||
`}</style>
|
||||
|
||||
Reference in New Issue
Block a user