diff --git a/docs/pages/_app.js b/docs/pages/_app.js index d506bd7ddb6ace..cbbf2a0391a4b4 100644 --- a/docs/pages/_app.js +++ b/docs/pages/_app.js @@ -214,6 +214,7 @@ function AppWrapper(props) { return ( + {fonts.map((font) => ( ))} diff --git a/docs/src/modules/components/Head.js b/docs/src/modules/components/Head.js index 4a753687b64cf0..a7ae243b4a2c71 100644 --- a/docs/src/modules/components/Head.js +++ b/docs/src/modules/components/Head.js @@ -21,7 +21,6 @@ export default function Head(props) { const preview = card.startsWith('http') ? card : `${HOST}${card}`; return ( - {title} {/* Twitter */} diff --git a/docs/src/modules/components/Link.tsx b/docs/src/modules/components/Link.tsx index 27b166e411df07..97731549c33700 100644 --- a/docs/src/modules/components/Link.tsx +++ b/docs/src/modules/components/Link.tsx @@ -11,7 +11,7 @@ import { useUserLanguage } from 'docs/src/modules/utils/i18n'; * * - /docs/src/modules/components/Link.tsx * - /examples/nextjs/src/Link.tsx - * - /examples/nextjs-with-typescript/src/components/Link.tsx + * - /examples/nextjs-with-typescript/src/Link.tsx */ // Add support for the sx prop for consistency with the other branches. diff --git a/docs/src/pages/guides/routing/routing.md b/docs/src/pages/guides/routing/routing.md index bd2fb31d34c51e..aad05eeb556b93 100644 --- a/docs/src/pages/guides/routing/routing.md +++ b/docs/src/pages/guides/routing/routing.md @@ -97,7 +97,7 @@ const LinkBehavior = React.forwardRef((props, ref) => ( Next.js has [a custom Link component](https://nextjs.org/docs/api-reference/next/link). The [example folder](https://github.com/mui-org/material-ui/tree/HEAD/examples/nextjs-with-typescript) provides adapters for usage with MUI. -- The first version of the adapter is the [`NextLinkComposed`](https://github.com/mui-org/material-ui/blob/HEAD/examples/nextjs-with-typescript/src/components/Link.tsx) component. +- The first version of the adapter is the [`NextLinkComposed`](https://github.com/mui-org/material-ui/blob/HEAD/examples/nextjs-with-typescript/src/Link.tsx) component. This component is unstyled and only responsible for handling the navigation. The prop `href` was renamed `to` to avoid a naming conflict. This is similar to react-router's Link component. diff --git a/examples/create-react-app-with-typescript/README.md b/examples/create-react-app-with-typescript/README.md index ca8c6861e9aefb..49dcb4a937385b 100644 --- a/examples/create-react-app-with-typescript/README.md +++ b/examples/create-react-app-with-typescript/README.md @@ -24,6 +24,10 @@ or: [![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/mui-org/material-ui/tree/master/examples/create-react-app-with-typescript) + + +[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/mui-org/material-ui/tree/master/examples/create-react-app-with-typescript) + ## The idea behind the example This example demonstrates how you can use [Create React App](https://github.com/facebookincubator/create-react-app) with [TypeScript](https://github.com/Microsoft/TypeScript). diff --git a/examples/create-react-app/README.md b/examples/create-react-app/README.md index bb72afcbec8a89..c25790da518be9 100644 --- a/examples/create-react-app/README.md +++ b/examples/create-react-app/README.md @@ -24,6 +24,10 @@ or: [![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/mui-org/material-ui/tree/master/examples/create-react-app) + + +[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/mui-org/material-ui/tree/master/examples/create-react-app) + ## The idea behind the example diff --git a/examples/gatsby/README.md b/examples/gatsby/README.md index 5c05fe4e2d4bba..91a6173418a6ba 100644 --- a/examples/gatsby/README.md +++ b/examples/gatsby/README.md @@ -18,12 +18,6 @@ npm install npm run develop ``` -or: - - - -[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/mui-org/material-ui/tree/master/examples/gatsby) - ## The idea behind the example The project uses [Gatsby](https://github.com/gatsbyjs/gatsby), which is a static site generator for React. diff --git a/examples/gatsby/plugins/gatsby-plugin-mui-emotion/gatsby-ssr.js b/examples/gatsby/plugins/gatsby-plugin-mui-emotion/gatsby-ssr.js index dc53a1d535d636..388bb20bb069aa 100644 --- a/examples/gatsby/plugins/gatsby-plugin-mui-emotion/gatsby-ssr.js +++ b/examples/gatsby/plugins/gatsby-plugin-mui-emotion/gatsby-ssr.js @@ -1,10 +1,24 @@ -/* eslint-disable import/prefer-default-export */ import * as React from 'react'; import { CacheProvider } from '@emotion/react'; import createEmotionServer from '@emotion/server/create-instance'; import { renderToString } from 'react-dom/server'; import getEmotionCache from './getEmotionCache'; +// Inject MUI styles first to match with the prepend: true configuration. +export const onPreRenderHTML = ({ getHeadComponents, replaceHeadComponents }) => { + const headComponents = getHeadComponents(); + headComponents.sort((x, y) => { + if (x.key === 'emotion-css-global' || x.key === 'emotion-css') { + return -1; + } + if (y.key === 'style') { + return 1; + } + return 0; + }); + replaceHeadComponents(headComponents); +}; + export const replaceRenderer = ({ bodyComponent, setHeadComponents, replaceBodyHTMLString }) => { const cache = getEmotionCache(); const { extractCriticalToChunks } = createEmotionServer(cache); @@ -17,7 +31,7 @@ export const replaceRenderer = ({ bodyComponent, setHeadComponents, replaceBodyH emotionStyles.styles.map((style) => (