Skip to content

Commit c29e7bf

Browse files
authored
Merge branch 'master' into Fix/typography
2 parents 8f95447 + 0c901c7 commit c29e7bf

File tree

20 files changed

+225
-75
lines changed

20 files changed

+225
-75
lines changed

.dumi/pages/index/components/Group.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ const Group: React.FC<React.PropsWithChildren<GroupProps>> = (props) => {
5050
fontWeight: 900,
5151
color: titleColor,
5252
// Special for the title
53-
fontFamily: `AliPuHui, ${token.fontFamily}`,
5453
fontSize: isMobile ? token.fontSizeHeading2 : token.fontSizeHeading1,
5554
}}
5655
>

.dumi/pages/index/components/PreviewBanner/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ const useStyle = createStyles(({ token, css, cx }, siteConfig: SiteContextProps)
8383
padding-inline: ${token.paddingXL}px;
8484
text-shadow: ${Array.from({ length: 5 }, () => textShadow).join(', ')};
8585
h1 {
86-
font-family: AliPuHui, ${token.fontFamily} !important;
8786
font-weight: 900 !important;
8887
font-size: ${token.fontSizeHeading2 * 2}px !important;
8988
line-height: ${token.lineHeightHeading2} !important;

.dumi/pages/index/components/Theme/MobileCarousel.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ const MobileCarousel: React.FC<MobileCarouselProps> = (props) => {
9494
style={{
9595
fontWeight: 900,
9696
color: mobileImageConfigList[currentSlider].titleColor,
97-
// Special for the title
98-
fontFamily: `AliPuHui, ${token.fontFamily}`,
9997
fontSize: token.fontSizeHeading2,
10098
}}
10199
>

.dumi/theme/common/ThemeSwitch/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ const ThemeSwitch: React.FC<ThemeSwitchProps> = () => {
100100
return;
101101
}
102102

103+
// 校验当前主题是否包含要切换的主题(避免 timeout in DOM update)
104+
if (theme.includes(key as ThemeName)) {
105+
return;
106+
}
107+
103108
// 亮色/暗色模式切换时应用动画效果
104109
if (key === 'dark' || key === 'light') {
105110
lastThemeKey.current = key;

.dumi/theme/common/styles/Reset.tsx

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,44 @@ export default () => {
99
<Global
1010
styles={css`
1111
@font-face {
12-
font-weight: normal;
13-
font-family: AlibabaPuHuiTi;
14-
src:
15-
url('//at.alicdn.com/t/webfont_6e11e43nfj.woff2') format('woff2'),
16-
url('//at.alicdn.com/t/webfont_6e11e43nfj.woff') format('woff'),
17-
/* chrome、firefox */ url('//at.alicdn.com/t/webfont_6e11e43nfj.ttf') format('truetype'); /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
12+
font-family: "AlibabaSans";
13+
font-style: normal;
14+
font-weight: 300;
1815
font-display: swap;
16+
src: url("//mdn.alipayobjects.com/huamei_iwk9zp/afts/file/A*1GSgSYDD_aIAAAAAQsAAAAgAegCCAQ/AlibabaSans-Light.woff2")
17+
format("woff2");
1918
}
20-
2119
@font-face {
22-
font-weight: bold;
23-
font-family: AlibabaPuHuiTi;
24-
src:
25-
url('//at.alicdn.com/t/webfont_exesdog9toj.woff2') format('woff2'),
26-
url('//at.alicdn.com/t/webfont_exesdog9toj.woff') format('woff'),
27-
/* chrome、firefox */ url('//at.alicdn.com/t/webfont_exesdog9toj.ttf')
28-
format('truetype'); /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */
20+
font-family: "AlibabaSans";
21+
font-style: normal;
22+
font-weight: 400;
2923
font-display: swap;
24+
src: url("//mdn.alipayobjects.com/huamei_iwk9zp/afts/file/A*2zEUQqnPNesAAAAAQtAAAAgAegCCAQ/AlibabaSans-Regular.woff2")
25+
format("woff2");
26+
}
27+
@font-face {
28+
font-family: "AlibabaSans";
29+
font-style: normal;
30+
font-weight: 500;
31+
font-display: swap;
32+
src: url("//mdn.alipayobjects.com/huamei_iwk9zp/afts/file/A*E_cxRbMlZqUAAAAAQuAAAAgAegCCAQ/AlibabaSans-Medium.woff2")
33+
format("woff2");
34+
}
35+
@font-face {
36+
font-family: "AlibabaSans";
37+
font-style: normal;
38+
font-weight: 600;
39+
font-display: swap;
40+
src: url("//mdn.alipayobjects.com/huamei_iwk9zp/afts/file/A*E_cxRbMlZqUAAAAAQuAAAAgAegCCAQ/AlibabaSans-Bold.woff2")
41+
format("woff2");
3042
}
31-
32-
// 组件丰富,选用自如定制主题随心所欲设计语言与研发框架1234567890 QWERTYUIOPLKJHGFDSAZXCVBNM,.mnbvcxzasdfghjklpoiuytrewq
33-
/* CDN 服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
3443
@font-face {
35-
font-weight: 900;
36-
font-family: 'AliPuHui';
37-
src:
38-
url('//at.alicdn.com/wf/webfont/exMpJIukiCms/Gsw2PSKrftc1yNWMNlXgw.woff2')
39-
format('woff2'),
40-
url('//at.alicdn.com/wf/webfont/exMpJIukiCms/vtu73by4O2gEBcvBuLgeu.woff') format('woff');
44+
font-family: "AlibabaSans";
45+
font-style: normal;
46+
font-weight: 700;
4147
font-display: swap;
48+
src: url("//mdn.alipayobjects.com/huamei_iwk9zp/afts/file/A*E_cxRbMlZqUAAAAAQuAAAAgAegCCAQ/AlibabaSans-Heavy.woff2")
49+
format("woff2");
4250
}
4351
4452
html {

.dumi/theme/layouts/DocLayout/index.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import dayjs from 'dayjs';
44
import 'dayjs/locale/zh-cn';
55

66
import React, { useEffect, useLayoutEffect, useRef } from 'react';
7-
import ConfigProvider from 'antd/es/config-provider';
7+
import { ConfigProvider, theme } from 'antd';
88
import zhCN from 'antd/es/locale/zh_CN';
99
import { Helmet, useOutlet, useSiteData } from 'dumi';
1010

@@ -38,6 +38,7 @@ const DocLayout: React.FC = () => {
3838
const timerRef = useRef<ReturnType<typeof setTimeout>>(null!);
3939
const { direction } = React.use(SiteContext);
4040
const { loading } = useSiteData();
41+
const { token } = theme.useToken();
4142

4243
useLayoutEffect(() => {
4344
if (lang === 'cn') {
@@ -108,7 +109,15 @@ const DocLayout: React.FC = () => {
108109
content="https://gw.alipayobjects.com/zos/rmsportal/rlpTLlbMzTNYuZGGCVYM.png"
109110
/>
110111
</Helmet>
111-
<ConfigProvider direction={direction} locale={lang === 'cn' ? zhCN : undefined}>
112+
<ConfigProvider
113+
direction={direction}
114+
locale={lang === 'cn' ? zhCN : undefined}
115+
theme={{
116+
token: {
117+
fontFamily: `AlibabaSans, ${token.fontFamily}`,
118+
},
119+
}}
120+
>
112121
<GlobalStyles />
113122
<Header />
114123
{content}

.dumi/theme/layouts/GlobalLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ const GlobalLayout: React.FC = () => {
104104
if (key === 'theme') {
105105
nextSearchParams = createSearchParams({
106106
...nextSearchParams,
107-
theme: value.filter((t) => t !== 'light'),
107+
theme: value,
108108
});
109109

110110
document

.dumi/theme/slots/Header/Logo.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Link from '../../common/Link';
66
import * as utils from '../../utils';
77

88
const useStyle = createStyles(({ token, css }) => {
9-
const { headerHeight, colorTextHeading, fontFamily, mobileMaxWidth } = token;
9+
const { headerHeight, colorTextHeading, mobileMaxWidth } = token;
1010

1111
return {
1212
logo: css`
@@ -16,7 +16,6 @@ const useStyle = createStyles(({ token, css }) => {
1616
color: ${colorTextHeading};
1717
font-weight: bold;
1818
font-size: 18px;
19-
font-family: AlibabaPuHuiTi, ${fontFamily}, sans-serif;
2019
line-height: ${headerHeight}px;
2120
letter-spacing: -0.18px;
2221
white-space: nowrap;

components/button/index.en-US.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ In Ant Design we provide 5 types of button.
2020

2121
- 🔵 Primary button: used for the main action, there can be at most one primary button in a section.
2222
- ⚪️ Default button: used for a series of actions without priority.
23-
- 🫥 Dashed button: commonly used for adding more actions.
23+
- 😶 Dashed button: commonly used for adding more actions.
2424
- 🔤 Text button: used for the most secondary action.
2525
- 🔗 Link button: used for external links.
2626

components/button/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ group:
2121

2222
- 🔵 主按钮:用于主行动点,一个操作区域只能有一个主按钮。
2323
- ⚪️ 默认按钮:用于没有主次之分的一组行动点。
24-
- 🫥 虚线按钮:常用于添加操作。
24+
- 😶 虚线按钮:常用于添加操作。
2525
- 🔤 文本按钮:用于最次级的行动点。
2626
- 🔗 链接按钮:一般用于链接,即导航至某位置。
2727

0 commit comments

Comments
 (0)