docs: fix ssr a link style (#43862)

This commit is contained in:
二货爱吃白萝卜 2023-07-28 11:17:29 +08:00 committed by GitHub
parent b2d7e86393
commit a96e1bf04e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 6 deletions

View File

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

View File

@ -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] }, () => {