[POC] Use ThemeCSSProvider as replacement for ThemeProvider#48652
Draft
silviuaavram wants to merge 5 commits into
Draft
[POC] Use ThemeCSSProvider as replacement for ThemeProvider#48652silviuaavram wants to merge 5 commits into
silviuaavram wants to merge 5 commits into
Conversation
Deploy preview
Bundle size
Check out the code infra dashboard for more information about this PR. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new @mui/tailwind package as a POC integration layer between MUI’s CSS variables (from CssVarsProvider) and Tailwind (v3 preset + v4 CSS directives), and wires it into the docs with a new integration page and demos.
Changes:
- Introduce
@mui/tailwind(Tailwind v3 preset + state-variant plugin + Tailwind v4v4.csstoken mapping). - Update docs to consume
@mui/tailwind/v4.cssand add a new “Tailwind components” integration page + demos. - Adjust repo config/deps to include the new workspace package and remove
postcss-importfrom docs.
Reviewed changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Adds TS path aliases for the new @mui/tailwind package. |
| pnpm-lock.yaml | Adds workspace link for @mui/tailwind and updates lock entries (incl. removal of postcss-import). |
| packages/mui-tailwind/src/v4.css | Tailwind v4 CSS integration: breakpoints, token mapping, utilities, and mui-* variants. |
| packages/mui-tailwind/src/preset.js | Tailwind v3 preset exposing MUI token mappings + plugin registration. |
| packages/mui-tailwind/src/plugin.js | Tailwind plugin adding mui-{state} / mui-not-{state} variants. |
| packages/mui-tailwind/README.md | Links to the docs integration page for setup and demos. |
| packages/mui-tailwind/package.json | Declares the new package metadata and entrypoint exports. |
| docs/postcss.config.js | Removes postcss-import from the docs PostCSS pipeline. |
| docs/pages/material-ui/integrations/tailwindcss/tailwindcss-components.js | Adds a new docs route for the Tailwind components page. |
| docs/pages/global.css | Imports @mui/tailwind/v4.css and updates layer ordering for Tailwind/MUI. |
| docs/package.json | Adds @mui/tailwind workspace dependency; removes postcss-import. |
| docs/data/material/integrations/tailwindcss/TailwindFilterChips.tsx | New TS demo using mui-selected: Tailwind variant on MUI ToggleButtons. |
| docs/data/material/integrations/tailwindcss/TailwindFilterChips.js | JS version of the filter chips demo. |
| docs/data/material/integrations/tailwindcss/TailwindDisabledState.tsx | New TS demo using mui-disabled: variant with Slider/Switch. |
| docs/data/material/integrations/tailwindcss/TailwindDisabledState.js | JS version of the disabled-state demo. |
| docs/data/material/integrations/tailwindcss/tailwindcss-v4.md | Points readers to the new @mui/tailwind package page. |
| docs/data/material/integrations/tailwindcss/tailwindcss-components.md | New docs page describing @mui/tailwind setup (v3 + v4) and demos. |
| docs/data/material/integrations/tailwindcss/TailwindCard.tsx.preview | Preview snippet for the Tailwind job card demo. |
| docs/data/material/integrations/tailwindcss/TailwindCard.tsx | New TS Tailwind-styled job card demo built from MUI components. |
| docs/data/material/integrations/tailwindcss/TailwindCard.js | JS version of the Tailwind job card demo (+ PropTypes). |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
39e2999 to
8b43394
Compare
128c3ce to
0c748fd
Compare
0c748fd to
da7fa88
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to act as a POC for using a CSSThemeProvider instead of ThemeProvider, which should not import anything Emotion related. To be used by consumers who want to replace Emotion styling with anything else: Tailwind, CSS Modules etc. It's one of the ways we can remove Emotion and keep the Theme generation at runtime. The other way is to generate the theme at build time and import the file. This PR will cover just the first option.
Progress:
docs/data/material/integrations/tailwindcss/tailwindcss-components.md.postcss-importanymore, as it also broke the import from @mui/tailwind.composeClassesto build the class name and also check the css modules object for the corresponding hashed class, and add it to the result when found.transitionvariables and also make sure they havemsinstead ofpxmeasurement.