Skip to content

[docs][joy-ui] Change dark theme component background color without affecting other states #42547

Open
@hsellik

Description

@hsellik

Related page

https://mui.com/joy-ui/customization/themed-components/

Kind of issue

Missing information

Issue description

I would assume that changing backgroundColor of a Joy UI component would not override other states such as hover and use the color from the default style for these states.

It is the case observed for the light mode. See the sandbox, hover the button and the color changes. However, when trying to do the same in dark mode, it overrides other states (see sandbox).

I couldn't find out from the documentation if this is intended behavior or not and what should be done to get a similar effect for the dark mode.

Context

I am trying to apply a custom backgroundColor to a Joy UI Button component which is in dark mode. However, it also overrides all other states which I do not wish to change and changing them all manually is tedious.

Search keywords: button, component, theme, background

Metadata

Metadata

Assignees

Labels

customization: themeCentered around the theming featuresdocsImprovements or additions to the documentationon holdThere is a blocker, we need to waitpackage: joy-uiSpecific to @mui/joysupport: docs-feedbackFeedback from documentation page

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions