You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
951 B
36 lines
951 B
2 years ago
|
import { theme } from 'antd';
|
||
|
import { useContext } from 'react';
|
||
|
import { ConfigContext } from 'antd/es/config-provider';
|
||
|
|
||
|
const { useToken } = theme;
|
||
|
|
||
|
const useSiteToken = () => {
|
||
|
const result = useToken();
|
||
|
const { getPrefixCls, iconPrefixCls } = useContext(ConfigContext);
|
||
|
const rootPrefixCls = getPrefixCls();
|
||
|
const { token } = result;
|
||
|
const siteMarkdownCodeBg = token.colorFillTertiary;
|
||
|
|
||
|
return {
|
||
|
...result,
|
||
|
token: {
|
||
|
...token,
|
||
|
headerHeight: 64,
|
||
|
menuItemBorder: 2,
|
||
|
mobileMaxWidth: 767.99,
|
||
|
siteMarkdownCodeBg,
|
||
|
antCls: `.${rootPrefixCls}`,
|
||
|
iconCls: `.${iconPrefixCls}`,
|
||
|
/** 56 */
|
||
|
marginFarXS: (token.marginXXL / 6) * 7,
|
||
|
/** 80 */
|
||
|
marginFarSM: (token.marginXXL / 3) * 5,
|
||
|
/** 96 */
|
||
|
marginFar: token.marginXXL * 2,
|
||
|
codeFamily: `'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,
|
||
|
},
|
||
|
};
|
||
|
};
|
||
|
|
||
|
export default useSiteToken;
|