fix(Typography): button with href wrapped by Typography showing incorrect color and flickering outline on hover (#56619)

* style: The typography component is showing styling issues, including with the button component

* style: refactor link styles for Button consistency

* style: modify mixins.ts file

* fix: reset border styles for Typography links

* fix: link style conflicts with ant-btn in typography component

* fix: link styles to avoid conflicts with Button component

---------

Co-authored-by: 遇见同学 <1875694521@qq.com>
This commit is contained in:
QdabuliuQ
2026-01-21 18:45:12 +08:00
committed by GitHub
parent 01fdc86b39
commit 092e37861a
2 changed files with 6 additions and 3 deletions

View File

@@ -72,6 +72,7 @@ const useStyle = createStyles(({ cssVar, token, css }) => ({
font-weight: 600;
font-size: 20px;
margin: 0 !important;
padding: 0;
`,
versionTag: css`
user-select: none;

View File

@@ -54,12 +54,14 @@ export const getTitleStyles: GenerateStyle<TypographyToken, CSSObject> = (token)
};
export const getLinkStyles: GenerateStyle<TypographyToken, CSSObject> = (token) => {
const { componentCls } = token;
const { componentCls, antCls } = token;
const btnCls = `${antCls}-btn`;
return {
'a&, a': {
// fix issue: https://github.com/ant-design/ant-design/issues/56606
// exclude ant-btn to avoid style conflicts with Button component when it renders as <a></a> tag (variant='link' with href)
[`a&:not(${btnCls}), a:not(${btnCls})`]: {
...operationUnit(token),
userSelect: 'text',
[`&[disabled], &${componentCls}-disabled`]: {
color: token.colorTextDisabled,