material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Dialog] Change background color with out editing the theme's canvas colour?

Open ghost opened this issue 11 years ago • 12 comments

Setting contentInnerStyle, contentStyle, or style = {{backgroundColor: "#ededed"}} doesn't seem to change it from white.

ghost avatar Aug 26 '15 19:08 ghost

I'm also interested by this too. It's impossible to change even by adding a custom class.

jgoux avatar Nov 04 '15 09:11 jgoux

I was hoping the style prop would work, but that oddly seems to change the overlayStyle instead.

beverlycodes avatar Apr 07 '16 13:04 beverlycodes

I have just spent the last several hours plumbing the depths of the Dialog component. It appears that there is a direct child DIV of the 'content' DIV that is unreachable. None of the *style props target this element, but it has essential styles applied to it. These include the background color of the entire dialog, border radius and height.

jcheroske avatar Apr 26 '16 19:04 jcheroske

Funny, we were looking for the same thing at the same time @jcheroske... I'm running down that rabbit hole myself today.

seanrankin avatar Apr 26 '16 20:04 seanrankin

Ok @jcheroske here's what I did:

// Declared a style with important...
.dialogRadiusHack > div:first-child {
  border-radius: 10px 10px 5px 5px !important;
}

//Set a custom style name on the dialog: 
contentClassName="dialogRadiusHack"

seanrankin avatar Apr 26 '16 20:04 seanrankin

!important wins the Internet yet again.

jcheroske avatar Apr 27 '16 03:04 jcheroske

Resolved by the new styling approach in next.

mbrookes avatar Jan 17 '17 14:01 mbrookes

@mbrookes what is next?

idangozlan avatar Jan 24 '17 12:01 idangozlan

@idangozlan https://github.com/callemall/material-ui/tree/next

mbrookes avatar Jan 25 '17 20:01 mbrookes

@mbrookes can you tell little bit what is new styling approach. This was the link provided in README.md, but its no more working.

hhsadiq avatar Mar 03 '17 17:03 hhsadiq

@hhsadiq It's JSS with jss-theme-reactor

Zuurkern avatar Mar 04 '17 13:03 Zuurkern

Work's in next with: CSS:

.paper{
  background-color: rgba(255, 255, 255, 0.90) !important;
}

JS/React:

<Paper elevation={4} className='paper'>

georgelivas avatar Mar 16 '18 06:03 georgelivas