Skip to content

[docs][icons] Fix Font Awesome Chip demo in dark mode#48576

Merged
mj12albert merged 3 commits into
mui:masterfrom
siriwatknp:worktree-fix-fontawesome-chip-dark
May 29, 2026
Merged

[docs][icons] Fix Font Awesome Chip demo in dark mode#48576
mj12albert merged 3 commits into
mui:masterfrom
siriwatknp:worktree-fix-fontawesome-chip-dark

Conversation

@siriwatknp
Copy link
Copy Markdown
Member

Problem

The second Font Awesome demo on the icons page (the one showing Chip + Icon) defines a nested theme via createTheme with MuiIcon styleOverrides. Without color schemes declared, that nested theme does not generate the dark-mode style layer, so the overrides don't apply when the docs are viewed in dark mode.

Fix

Add colorSchemes: { light: true, dark: true } to the demo's createTheme call so the generated styles apply in both modes.

 const theme = createTheme({
+  colorSchemes: { light: true, dark: true },
   components: {
     MuiIcon: { ... },
   },
 });

Applied to both FontAwesomeIconSize.tsx and FontAwesomeIconSize.js.

Add colorSchemes light/dark to the demo theme so MuiIcon styleOverrides apply in dark mode.
@code-infra-dashboard
Copy link
Copy Markdown

code-infra-dashboard Bot commented May 27, 2026

Deploy preview

https://deploy-preview-48576--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.

@siriwatknp siriwatknp added the docs Improvements or additions to the documentation. label May 28, 2026
@mj12albert mj12albert enabled auto-merge (squash) May 29, 2026 10:58
@mj12albert mj12albert merged commit c7bd53b into mui:master May 29, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants