Skip to content

Commit 97aaae5

Browse files
authored
[code-infra] Move font loading to @mui/docs (#47385)
1 parent cb4d8ac commit 97aaae5

25 files changed

+39
-35
lines changed

docs/pages/_app.js

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,42 +31,9 @@ import SvgMuiLogomark, {
3131
} from 'docs/src/icons/SvgMuiLogomark';
3232
import './global.css';
3333
import '../public/static/components-gallery/base-theme.css';
34-
import { Inter, Roboto } from 'next/font/google';
35-
import localFont from 'next/font/local';
3634
import * as config from '../config';
3735

38-
const inter = Inter({
39-
weight: ['300', '400', '500', '600', '700'],
40-
subsets: ['latin'],
41-
});
42-
43-
const roboto = Roboto({
44-
weight: ['300', '400', '500', '700'],
45-
style: ['normal', 'italic'],
46-
subsets: ['latin'],
47-
});
48-
49-
const generalSans = localFont({
50-
declarations: [{ prop: 'font-family', value: 'General Sans' }],
51-
src: [
52-
{ path: '../public/static/fonts/GeneralSans-Regular.woff2', weight: '400', style: 'normal' },
53-
{ path: '../public/static/fonts/GeneralSans-Medium.woff2', weight: '500', style: 'normal' },
54-
{ path: '../public/static/fonts/GeneralSans-Semibold.woff2', weight: '600', style: 'normal' },
55-
{ path: '../public/static/fonts/GeneralSans-Bold.woff2', weight: '700', style: 'normal' },
56-
],
57-
});
58-
59-
const ibmPlexSans = localFont({
60-
declarations: [{ prop: 'font-family', value: 'IBM Plex Sans' }],
61-
src: [
62-
{ path: '../public/static/fonts/IBMPlexSans-Regular.woff2', weight: '400', style: 'normal' },
63-
{ path: '../public/static/fonts/IBMPlexSans-Medium.woff2', weight: '500', style: 'normal' },
64-
{ path: '../public/static/fonts/IBMPlexSans-SemiBold.woff2', weight: '600', style: 'normal' },
65-
{ path: '../public/static/fonts/IBMPlexSans-Bold.woff2', weight: '700', style: 'normal' },
66-
],
67-
});
68-
69-
export const fontClasses = `${inter.className} ${roboto.className} ${generalSans.className} ${ibmPlexSans.className}`;
36+
export { fontClasses } from '@mui/docs/nextFonts';
7037

7138
// Remove the license warning from demonstration purposes
7239
LicenseInfo.setLicenseKey(process.env.NEXT_PUBLIC_MUI_LICENSE);

packages/mui-docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"homepage": "https://github.com/mui/material-ui/tree/master/packages/mui-docs",
2323
"scripts": {
24-
"build": "code-infra build --copy \"src/translations/translations.json\" --copy \"src/translations/translations.json:esm\"",
24+
"build": "code-infra build --copy \"src/translations/translations.json\" --copy \"src/translations/translations.json:esm\" --copy \"src/nextFonts/fonts\" --copy \"src/nextFonts/fonts:esm\"",
2525
"release": "pnpm build && pnpm publish",
2626
"test": "exit 0",
2727
"typescript": "tsc -p tsconfig.json"
62.3 KB
Binary file not shown.
20.7 KB
Binary file not shown.
64.4 KB
Binary file not shown.
22.4 KB
Binary file not shown.
64.7 KB
Binary file not shown.
22.5 KB
Binary file not shown.
Binary file not shown.
64.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)