mui / mui/material-ui

[RFC][CssVarsProvider] Ability to change shadow color on each color scheme

Open
#39,144 4 comments 1 reaction 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Sep 25, 2023.

customization: theme RFC scope: system
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

What's the problem? 🤔

Current experimental_extendTheme will accpet Partial<Record<SupportedColorScheme, ColorSystemOptions>> which is:

export interface ColorSystem {
  palette: Palette & CssVarsPalette;
  opacity: Opacity;
  overlays: Overlays;
}

But we need to set each shadow color on each color scheme light and dark (or another).

What are the requirements? ❓

Nothing

What are our options? 💡

Never thought

Proposed solution 🟢

Change type of ColorSystem to:

export interface ColorSystem {
  palette: Palette & CssVarsPalette;
  opacity: Opacity;
  overlays: Overlays;
  shadows: Theme['shadows'];
}

And thus we need to make change to generate processes?

Default approach for this was, setting shadows with theme palette mode like:

shadows: mode === 'light' ? lightShadows : darkShadows // Also component's approach is same

But this approach will not work

Resources and benchmarks 🔗

No response

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.