mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.36k stars 32.13k forks source link

[joy-ui] How to customize the JoyBreadcrumbs item color #43570

Closed rick-liyue-huang closed 3 hours ago

rick-liyue-huang commented 2 weeks ago

Steps to reproduce

Link to live example: (required)

Steps:

  1. I'm now hoping to customize the JoyBreadcrumbs item color;
  2. I try to use codes like the following content:
    export const raulandAdvancedThemes = extendTheme({
    cssVarPrefix: 'test',
    colorSchemes,
    radius,
    typography,
    fontFamily,
    breakpoints,
    components: {
        JoyBreadcrumbs: {
            styleOverrides: {
                root: ({ theme, ownerState }) => ({
                    // color: 'var(--rauland-palette-illustrate-300)',
                    '& .MuiBreadcrumbs-separator': {
                        color: 'var(--rauland-palette-illustrate-300)',
                    },
                    '& .MuiBreadcrumbs-li': {
                        backgroundColor: 'white',
                        color: 'red', 
                    },
                    backgroundColor: 'var(--rauland-palette-illustrate-100)',
                    '&:hover': {
                        color: 'var(--rauland-palette-illustrate-50)',
                        backgroundColor: 'var(--rauland-palette-illustrate-200)',
                    },
                    '&:active': {
                        color: 'var(--rauland-palette-illustrate-50)',
                        backgroundColor: 'var(--rauland-palette-illustrate-200)',
                    },
                        color: 'var(--rauland-palette-neutral-300)',
                    },
                }),
            },
        },
    },
    })
  3. I found that '& .MuiBreadcrumbs-li': { backgroundColor: 'white', color: 'red', } color: 'red' is not woking properly

Current behavior

the '& .MuiBreadcrumbs-li': { backgroundColor: 'white', color: 'red', } color: 'red' not work properly

Expected behavior

hope that the items in the Breadcrumbs Show items with red color

Context

react 18, vite,

Your environment

npx @mui/envinfo ``` Don't forget to mention which browser you used. Output from `npx @mui/envinfo` goes here. ```

Search keywords: JoyBreadcrumbs, customize, .MuiBreadcrumbs-li Order ID: 97037

Search keywords:

siriwatknp commented 1 week ago

@rick-liyue-huang Can you provide a reproducible CodeSandbox?

github-actions[bot] commented 3 hours ago

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.