mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
fix: update genStyleUtils to correct linkStyle (#52888)
* fix: update genStyleUtils to correct linkStyle * feat: compatible with the "a" tag inside the element --------- Co-authored-by: thinkasany <480968828@qq.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import { genStyleUtils } from '@ant-design/cssinjs-utils';
|
||||
import type { GetCompUnitless } from '@ant-design/cssinjs-utils/es/util/genStyleUtils';
|
||||
|
||||
import { ConfigContext, defaultIconPrefixCls } from '../../config-provider/context';
|
||||
import { genCommonStyle, genLinkStyle, genIconStyle } from '../../style';
|
||||
import { genCommonStyle, genIconStyle, genLinkStyle } from '../../style';
|
||||
import type { AliasToken, ComponentTokenMap, SeedToken } from '../interface';
|
||||
import useLocalToken, { unitless } from '../useToken';
|
||||
|
||||
@@ -30,10 +30,14 @@ export const { genStyleHooks, genComponentStyleHook, genSubStyleComponent } = ge
|
||||
const { csp } = useContext(ConfigContext);
|
||||
return csp ?? {};
|
||||
},
|
||||
getResetStyles: (token, config) => [
|
||||
{ '&': genLinkStyle(token) },
|
||||
genIconStyle(config?.prefix.iconPrefixCls ?? defaultIconPrefixCls),
|
||||
],
|
||||
getResetStyles: (token, config) => {
|
||||
const linkStyle = genLinkStyle(token);
|
||||
return [
|
||||
linkStyle,
|
||||
{ '&': linkStyle },
|
||||
genIconStyle(config?.prefix.iconPrefixCls ?? defaultIconPrefixCls),
|
||||
];
|
||||
},
|
||||
getCommonStyle: genCommonStyle,
|
||||
getCompUnitless: (() => unitless) as GetCompUnitless<ComponentTokenMap, AliasToken>,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user