ant-design/.dumi/theme/common/styles/HeadingAnchor.tsx
lijianan 2acb7b217a
site: use css token (#48294)
* site: use css token

* fix: fix

* fix: fix

* fix: fix

* fix: fix

* fix: fix

* fix: fix

* fix: fix
2024-04-06 16:11:17 +08:00

48 lines
1.0 KiB
TypeScript

import React from 'react';
import { css, Global } from '@emotion/react';
import { useTheme } from 'antd-style';
export default () => {
const token = useTheme();
return (
<Global
styles={css`
h1,
h2,
h3,
h4,
h5,
h6 {
> a[aria-hidden]:first-child {
float: left;
width: 20px;
padding-inline-end: ${token.paddingXXS}px;
font-size: 0;
line-height: inherit;
text-align: right;
padding-inline-end: ${token.paddingXXS}px;
margin-inline-start: -${token.marginLG}px;
[data-direction='rtl'] & {
float: right;
}
&:hover {
border: 0;
}
> .icon-link::before {
font-size: ${token.fontSizeXL}px;
content: '#';
}
}
&:not(:hover) > a[aria-hidden]:first-child > .icon-link {
visibility: hidden;
}
}
`}
/>
);
};