Skip to content

Commit

Permalink
docs: fix anchor positioning (ant-design#44348)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadCcc authored Aug 22, 2023
1 parent 80e1bc8 commit 70d9a90
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions .dumi/theme/common/styles/Common.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { css, Global } from '@emotion/react';
import React from 'react';
import { useTheme } from 'antd-style';

export default () => (
<Global
styles={css`
export default () => {
const { headerHeight, margin } = useTheme();

return (
<Global
styles={css`
body,
div,
dl,
Expand Down Expand Up @@ -55,6 +59,11 @@ export default () => (
vertical-align: middle;
border-style: none;
}
html {
scroll-padding-top: ${headerHeight + margin}px;
}
`}
/>
);
/>
);
};

0 comments on commit 70d9a90

Please sign in to comment.