[docs][icons] Fix Font Awesome Chip demo in dark mode by siriwatknp · Pull Request #48576 · mui/material-ui (original) (raw)
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.