Decision

<aside> ✅ Option: Why?

</aside>

Context

Since the rebranding of the website and Joy UI, the emotion React theme context is not hosting the Material UI theme structure anymore.

We need to have a decision around:

An earlier proposal:

Problems

  1. Building a new page always inherits the branding theme. This breaks the playground theme of isolation. Making it harder to reproduce developers’ CodeSandbox locally.
  2. Nesting theme providers create bugs, e.g. the spacing difference in https://github.com/mui/material-ui/pull/35096#discussion_r1022186156. We saw nastier ones in the past.

Options

A. Bypass the emotion theme context

The idea in this option is to import a static theme in all the docs-infra components that are rendered in the docs, where Joy UI might be present in the parent context. To make this work, we would need to add an invariant in the runtime to catch issues early on. This would be very close to https://vanilla-extract.style/

Pros:

Cons: