mui / mui/material-ui

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

Open
#42,547 1 comment 0 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Jun 6, 2024.

customization: theme docs on hold package: joy-ui scope: all components support: docs-feedback
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.