Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 1 addition & 34 deletions docs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,42 +31,9 @@ import SvgMuiLogomark, {
} from 'docs/src/icons/SvgMuiLogomark';
import './global.css';
import '../public/static/components-gallery/base-theme.css';
import { Inter, Roboto } from 'next/font/google';
import localFont from 'next/font/local';
import * as config from '../config';

const inter = Inter({
weight: ['300', '400', '500', '600', '700'],
subsets: ['latin'],
});

const roboto = Roboto({
weight: ['300', '400', '500', '700'],
style: ['normal', 'italic'],
subsets: ['latin'],
});

const generalSans = localFont({
declarations: [{ prop: 'font-family', value: 'General Sans' }],
src: [
{ path: '../public/static/fonts/GeneralSans-Regular.woff2', weight: '400', style: 'normal' },
{ path: '../public/static/fonts/GeneralSans-Medium.woff2', weight: '500', style: 'normal' },
{ path: '../public/static/fonts/GeneralSans-Semibold.woff2', weight: '600', style: 'normal' },
{ path: '../public/static/fonts/GeneralSans-Bold.woff2', weight: '700', style: 'normal' },
],
});

const ibmPlexSans = localFont({
declarations: [{ prop: 'font-family', value: 'IBM Plex Sans' }],
src: [
{ path: '../public/static/fonts/IBMPlexSans-Regular.woff2', weight: '400', style: 'normal' },
{ path: '../public/static/fonts/IBMPlexSans-Medium.woff2', weight: '500', style: 'normal' },
{ path: '../public/static/fonts/IBMPlexSans-SemiBold.woff2', weight: '600', style: 'normal' },
{ path: '../public/static/fonts/IBMPlexSans-Bold.woff2', weight: '700', style: 'normal' },
],
});

export const fontClasses = `${inter.className} ${roboto.className} ${generalSans.className} ${ibmPlexSans.className}`;
export { fontClasses } from '@mui/docs/nextFonts';

// Remove the license warning from demonstration purposes
LicenseInfo.setLicenseKey(process.env.NEXT_PUBLIC_MUI_LICENSE);
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"homepage": "https://github.com/mui/material-ui/tree/master/packages/mui-docs",
"scripts": {
"build": "code-infra build --copy \"src/translations/translations.json\" --copy \"src/translations/translations.json:esm\"",
"build": "code-infra build --copy \"src/translations/translations.json\" --copy \"src/translations/translations.json:esm\" --copy \"src/nextFonts/fonts\" --copy \"src/nextFonts/fonts:esm\"",
"release": "pnpm build && pnpm publish",
"test": "exit 0",
"typescript": "tsc -p tsconfig.json"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
37 changes: 37 additions & 0 deletions packages/mui-docs/src/nextFonts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { Inter, Roboto } from 'next/font/google';
import localFont from 'next/font/local';

export const inter = Inter({
weight: ['300', '400', '500', '600', '700'],
subsets: ['latin'],
});

export const roboto = Roboto({
weight: ['300', '400', '500', '700'],
style: ['normal', 'italic'],
subsets: ['latin'],
});

export const generalSans = localFont({
declarations: [{ prop: 'font-family', value: 'General Sans' }],
src: [
{ path: './fonts/GeneralSans-Regular.woff2', weight: '400', style: 'normal' },
{ path: './fonts/GeneralSans-Medium.woff2', weight: '500', style: 'normal' },
{ path: './fonts/GeneralSans-Semibold.woff2', weight: '600', style: 'normal' },
{ path: './fonts/GeneralSans-Bold.woff2', weight: '700', style: 'normal' },
],
});

export const ibmPlexSans = localFont({
declarations: [{ prop: 'font-family', value: 'IBM Plex Sans' }],
src: [
{ path: './fonts/IBMPlexSans-Regular.woff2', weight: '400', style: 'normal' },
{ path: './fonts/IBMPlexSans-Medium.woff2', weight: '500', style: 'normal' },
{ path: './fonts/IBMPlexSans-SemiBold.woff2', weight: '600', style: 'normal' },
{ path: './fonts/IBMPlexSans-Bold.woff2', weight: '700', style: 'normal' },
],
});

export const fonts = [inter, roboto, generalSans, ibmPlexSans];

export const fontClasses = fonts.map((font) => font.className).join(' ');
Loading