Skip to content

[docs-infra] Move BrandingCssVarsProvider to _app.js#47721

Draft
Janpot wants to merge 11 commits intomui:masterfrom
Janpot:bransing
Draft

[docs-infra] Move BrandingCssVarsProvider to _app.js#47721
Janpot wants to merge 11 commits intomui:masterfrom
Janpot:bransing

Conversation

@Janpot
Copy link
Member

@Janpot Janpot commented Feb 6, 2026

Make branding theme provider reusable without:

  • unnecessarily recreating theme objects on each usage
  • rendering components that are meant to be singletons (<NextNProgressBar />, <CssBaseline />, <SkipLink />...)

The goal is to be able to reuse as much as possible from the branding theme when we style things like the cookiebanner which should appear on every page, but live outside of the main branding theme provider

@Janpot Janpot added the scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305). label Feb 6, 2026
@Janpot Janpot changed the title [code-infra] Move BrandingCssVarsProvider to _app.js [docs-infra] Move BrandingCssVarsProvider to _app.js Feb 6, 2026
@mui-bot
Copy link

mui-bot commented Feb 6, 2026

Netlify deploy preview

https://deploy-preview-47721--material-ui.netlify.app/

Bundle size report

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 6c22bd5

@oliviertassinari
Copy link
Member

oliviertassinari commented Feb 6, 2026

Move BrandingCssVarsProvider to _app.js

As far as I know, we can't do this change because we need docs/pages/_app.js to be barebone so when we create paygrounds we see default behaviors, e.g. theme of our components.

There is probably a root cause that we need to fix for our users too anyway?

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 6, 2026
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Feb 9, 2026
@Janpot
Copy link
Member Author

Janpot commented Feb 9, 2026

yeah, change of tac. Exporting a BrandingCssThemeProvider and make it efficient by building the theme only once (or at most twice if rtl option is set)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs-infra Involves the docs-infra product (https://www.notion.so/mui-org/b9f676062eb94747b6768209f7751305).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments