fix(link): fix hard-coded background color (#347)

This commit is contained in:
Zhao Lei
2020-07-24 17:28:40 +08:00
committed by GitHub
parent e37bf8fd94
commit f96fdcb5bf
2 changed files with 3 additions and 2 deletions

View File

@@ -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>"

View File

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