Skip to content

[test] Configure Tailwind CSS in the visual-regression app#48575

Merged
Janpot merged 3 commits into
mui:masterfrom
Janpot:worktree-tailwind-regressions
May 27, 2026
Merged

[test] Configure Tailwind CSS in the visual-regression app#48575
Janpot merged 3 commits into
mui:masterfrom
Janpot:worktree-tailwind-regressions

Conversation

@Janpot

@Janpot Janpot commented May 26, 2026

Copy link
Copy Markdown
Member

Wires Tailwind v4 into the regression Vite app so demos using Tailwind utilities (currently TextFieldTailwind) screenshot with the correct styles instead of unstyled.

Enabling enableCssLayer also brings the regression renderer in line with how mui.com renders, which improves 6 other screenshots that now match the docs site more closely - those Argos diffs are intentional, not regressions.

Closes mui/mui-public#1502

The Argos regression bundle pulls in demos that use Tailwind utilities
(currently `docs/data/material/integrations/tailwindcss/TextFieldTailwind`),
but the Vite app at `test/regressions/` never loaded Tailwind, so those
classes resolved to no styles and screenshots showed the demos unstyled.

Wire in Tailwind v4 via `@tailwindcss/vite` and reuse `docs/tailwind.config.mjs`
through the `@config` directive so the regression bundle resolves utilities
identically to the docs site. Preflight is intentionally omitted to avoid
resetting MUI's baseline and breaking unrelated screenshots.

Closes mui/mui-public#1502
@code-infra-dashboard

code-infra-dashboard Bot commented May 26, 2026

Copy link
Copy Markdown

Deploy preview

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

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 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


Check out the code infra dashboard for more information about this PR.

Janpot added 2 commits May 26, 2026 17:41
Declaring `@layer theme, base, mui, components, utilities;` establishes
the cascade-layer order so utilities outrank mui, and enabling
`StyledEngineProvider enableCssLayer` makes MUI's Emotion styles emit
inside `@layer mui`. Without this, MUI's unlayered styles beat Tailwind's
layered utilities and demos like `TextFieldTailwind` render with the
default MUI typography/spacing instead of the Tailwind overrides — same
mechanism the docs site uses to render the demo correctly.
@Janpot Janpot marked this pull request as ready for review May 26, 2026 17:55
@Janpot Janpot requested a review from a team May 26, 2026 17:55
@Janpot Janpot merged commit 6a19704 into mui:master May 27, 2026
18 checks passed
@oliviertassinari oliviertassinari added test type: bug It doesn't behave as expected. labels May 27, 2026
@oliviertassinari

Copy link
Copy Markdown
Member

+1 for the fix, we need a much better integration story with Tailwind CSS, so we need a stronger test suite with it.

Now, seeing the change, vs. the one used to solve https://mui-org.slack.com/archives/C02P87NQLJC/p1778866246836179?thread_ts=1778866246.836179&cid=C02P87NQLJC for example. I have added Tailwind CSS as another on mui/mui-public#199.

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

Labels

test type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[code-infra] Screenshot - Configure Tailwind CSS

3 participants