Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Create the docs theme once #34954

Merged
merged 1 commit into from Nov 1, 2022

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Oct 30, 2022

No need to create the same theme over and over again between each BrandingProvider instance. In the Joy UI pages, we mount this component a lot of times which can lead to a lot of console.log when you try to debug it.


Off-topic it seems that there are way too many ThemeProvider used in the pages, but it's a different problem, so I'm not looking into it. I think that what we need is:

  1. One Material UI customized branding theme provider at the root of the page (not inside _app)
  2. One raw Material UI theme provider for each Material UI demos, one raw Joy UI theme provider for each Joy UI demo, etc.

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation core Infrastructure work going on behind the scenes labels Oct 30, 2022
'Ubuntu Mono',
'monospace',
].join(','),
fontFamilyCode: ['Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', 'monospace'].join(','),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sync with docs/public/static/styles/prism-okaidia.css font family.

@mui-bot
Copy link

mui-bot commented Oct 30, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-34954--material-ui.netlify.app/

No bundle size changes

Generated by 🚫 dangerJS against b85ea74

@Janpot
Copy link
Member

Janpot commented Oct 31, 2022

@bharatkashyap Shall we do this in Toolpad as well?

@oliviertassinari (off-topic), we greatly simplified the theme switching logic in Toolpad using our useLocalStorageState hook. With the added bonus of automatically syncing theme switches across all tabs. Perhaps worth bringing this to the docs as well?

@oliviertassinari
Copy link
Member Author

@Janpot I think for Jun to explore, we have a bug right now: #33545 (comment).

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@siriwatknp siriwatknp merged commit a761abb into mui:master Nov 1, 2022
@oliviertassinari oliviertassinari deleted the docs-theme-once branch November 1, 2022 11:10
daniel-rabe pushed a commit to daniel-rabe/material-ui that referenced this pull request Nov 29, 2022
feliperli pushed a commit to jesrodri/material-ui that referenced this pull request Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants