question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Shadows overrides

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

Shadows should be configurable and extensible the same way as the colour palette

Examples 🌈

declare module '@mui/material/styles/createShadow' {
  interface DepthRange {
       0: string,
       1: string,
       2: string,
       3: string,
       4: string
  }

  interface Shadow {
      neutral: DepthRange ,
      downward: DepthRange ,
      upward: DepthRange 
  }
}

<Box sx={{ boxShadow: 'neutral.0' }}>…
<Box sx={{ boxShadow: 'downward.3' }}>…
<Box sx={{ boxShadow: 'upward.4' }}>…
<Box sx={{ boxShadow: 'neutral.3' }}>…

Motivation 🔦

Make MUI a more customizable extensible UI framework

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
theHasanascommented, Dec 6, 2021

Any updates on this issue?

A very simple patch that worked for me was changing the file at @mui/material/styles/shadows.d.ts like this:

export interface Shadows {
  0: 'none';
  1: string;
  2: string;
  3: string;
  4: string;
  5: string;
  6: string;
  7: string;
  8: string;
  9: string;
  10: string;
  11: string;
  12: string;
  13: string;
  14: string;
  15: string;
  16: string;
  17: string;
  18: string;
  19: string;
  20: string;
  21: string;
  22: string;
  23: string;
  24: string;
};
declare const shadows: Shadows;
export default shadows;

I was then able to augment the interface and extend the theme.

2reactions
siriwatknpcommented, Oct 6, 2021

@mnajdova Thanks, me and @danilo-leal will take this into account for the new design system.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<type> '<typename>' shadows an overridable method in the ...
If you want to override the base method, this method must be declared 'Overrides'. A programming element is declared with the same name...
Read more >
'Shadows' vs. 'Overrides' in VB.NET - Stack Overflow
Shadows is a distinct and useful concept. It hides all base class methods with the same name and forces the use of the...
Read more >
Overriding Vs Shadowing in C# - C# Corner
This article will help you understand the difference between shadowing (method hiding) and overriding.
Read more >
Support Shadows overrides · mui/material-ui@961cb63 · GitHub
It includes Material UI that implement Google's Material Design. - Support Shadows overrides · mui/material-ui@961cb63.
Read more >
How to override shadow strength for directional light?
The shadow strength of 1 means 100% shadow, 0% light, so it's physically and logically impossible to exceed 1. The shadow color is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found