-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC][CssVarsProvider] Ability to change shadow color on each color scheme #39144
Comments
Before we dive into the solution, could you share the real use cases for light and dark shadows? How does it look like between light and dark mode? |
Thank you for the reply. Well, my use case is when using light theme, shadows are like default one, but at the same value (meant like shadows[0]) with dark theme, it should be no shadows. We used to used this approach like doing: const theme = createTheme({
components: {
MuiPaper: {
styleOverrides: {
root: {
shadow: mode === 'light' ? shadows[0] : shadows[1],
},
},
},
},
}); |
I'll add another real use case that is blocking my ability to get rid of dark mode flicker, and I think it's fairly common as the values are a pattern in MUI paid templates. createTheme({
colorSchemes: {
light: {
palette: light,
shadows: [
'none',
'0 3px 6px 0 rgba(140, 152, 164, 0.25)',
'0 12px 15px rgba(140, 152, 164, 0.1)',
'0 6px 24px 0 rgba(140, 152, 164, 0.125)',
...Array(21).fill('0 10px 40px 10px rgba(140, 152, 164, 0.175)'),
],
},
dark:
{
palette: dark,
shadows: [
'none',
'0 3px 6px 0 rgba(0, 0, 0, 0.25)',
'0 12px 15px rgba(0, 0, 0, 0.1)',
'0 6px 24px 0 rgba(0, 0, 0, 0.125)',
...Array(21).fill('0 10px 40px 10px rgba(0, 0, 0, 0.175)'),
],
},
},
// ... |
What's the problem? 🤔
Current
experimental_extendTheme
will accpetPartial<Record<SupportedColorScheme, ColorSystemOptions>>
which is:But we need to set each
shadow
color on each color schemelight
anddark
(or another).What are the requirements? ❓
Nothing
What are our options? 💡
Never thought
Proposed solution 🟢
Change type of
ColorSystem
to:And thus we need to make change to generate processes?
Default approach for this was, setting shadows with theme palette mode like:
But this approach will not work
Resources and benchmarks 🔗
No response
The text was updated successfully, but these errors were encountered: