mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
docs: fix ssr a link style (#43862)
This commit is contained in:
parent
b2d7e86393
commit
a96e1bf04e
@ -110,6 +110,11 @@ const RoutesPlugin = (api: IApi) => {
|
||||
.map((file) => {
|
||||
let globalStyles = '';
|
||||
|
||||
// Debug for file content: uncomment this if need check raw out
|
||||
// const tmpFileName = `_${file.path.replace(/\//g, '-')}`;
|
||||
// const tmpFilePath = path.join(api.paths.absOutputPath, tmpFileName);
|
||||
// fs.writeFileSync(tmpFilePath, file.content, 'utf8');
|
||||
|
||||
// extract all emotion style tags from body
|
||||
file.content = file.content.replace(/<style data-emotion[\S\s]+?<\/style>/g, (s) => {
|
||||
globalStyles += s;
|
||||
|
@ -82,12 +82,15 @@ export default function genComponentStyleHook<ComponentName extends OverrideComp
|
||||
};
|
||||
|
||||
// Generate style for all a tags in antd component.
|
||||
useStyleRegister({ ...sharedConfig, path: ['Shared', rootPrefixCls] }, () => [
|
||||
{
|
||||
// Link
|
||||
'&': genLinkStyle(token),
|
||||
},
|
||||
]);
|
||||
useStyleRegister(
|
||||
{ ...sharedConfig, clientOnly: false, path: ['Shared', rootPrefixCls] },
|
||||
() => [
|
||||
{
|
||||
// Link
|
||||
'&': genLinkStyle(token),
|
||||
},
|
||||
],
|
||||
);
|
||||
|
||||
return [
|
||||
useStyleRegister({ ...sharedConfig, path: [component, prefixCls, iconPrefixCls] }, () => {
|
||||
|
Loading…
Reference in New Issue
Block a user