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.

[Paper] Overriding the Paper component in a Menu doesn't work as in v4

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

when using the following theme overrides:

const theme = createTheme({
  components: {
    MuiMenu: {
      styleOverrides: {
        paper: { borderRadius: 4 }
      }
    },
    MuiPaper: {
      styleOverrides: {
        rounded: { borderRadius: 30 }
      }
    }
  }
})

the paper used for menu shows up with border-radius=30px.

Expected behavior 🤔

I would expect that paper used in the context of a menu item be displayed with border-radius=4px (this worked as expected in MUI 4), because it seems more specific. Unless I’m wrong, in which case I wonder how could I remove the “rounded” class from the paper in a context of a menu using global theme.

Steps to reproduce 🕹

https://codesandbox.io/s/mui-theme-override-bug-66q5r

Context 🔦

This caused most menus of my application looked rounded after v4 -> v5 migration.

Your environment 🌎

Latest available mui/emotion packages - see sandbox

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
sthenaultcommented, Mar 30, 2022

Hello, any update on this? Thx!

0reactions
TheGLandercommented, Oct 16, 2022

I think I’m gonna take this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Material-UI React: Global theme override for Paper component
I use many instances of the Paper component. I want to apply margins and padding to all them at once, without manually repeating...
Read more >
Paper API - Material UI - MUI
API reference docs for the React Paper component. ... The name MuiPaper can be used when providing default props or style overrides in...
Read more >
4 Ways to Override Material UI Styles | by John Au-Yeung
The StyleProvider let us override the styles of the child components of it. Cons. The JSS integration doesn't seem to be working and...
Read more >
Learn how to use parent pages in InDesign - Adobe Support
Deselect Allow Parent Item Overrides On Selection on the Pages panel menu. Parent items that do not allow overrides have no frame edge...
Read more >
Global Styling with Material-UI Theme Overrides and Props
While this works, these modifications won't apply anywhere else in the app where we use the Material-UI Button component. We could make a...
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