react-modal-dialog icon indicating copy to clipboard operation
react-modal-dialog copied to clipboard

Custom CSS

Open artsx opened this issue 9 years ago • 4 comments

Hello, I'm trying to find how to customize CSS, I have located the files and .JS I could get what I wanted. But is there another way directly into the component or the modal is called to customize it?

I could put className and add what I needed to style the modal but I do not put classes for each element type of the background, the overall modal

If you have a solution I'm interested,

Best regards,

screen shot 2016-09-21 at 12 10 19

artsx avatar Sep 21 '16 10:09 artsx

@artsx actually you can. Just pass style prop to ModalDialog component and this styles will be applied as well.

m1n0s avatar Nov 09 '16 19:11 m1n0s

@artsx sorry for the late response, but you can actually just write your own version of ModalDialog to do this, then your code would look like this...

<ModalContainer>
  <MyOwnModal/>
</ModalContainer>

qimingweng avatar Nov 15 '16 16:11 qimingweng

Is there any way for me to customise styles for ModalContainer? I want to lower the default opacity of 0.85.

ghost avatar Dec 13 '16 11:12 ghost

For future reference for anyone who wants to customise the background color, instead expand into a ModalPortal and ModalBackground:

<ModalPortal>
  <ModalBackground zIndex={1000} backgroundColor='#00000040'>
    <ModalDialog>...</ModalDialog>
  </ModalBackground>
</ModalPortal>

Or ditch this library and use portals directly with your own dialog code: https://reactjs.org/docs/portals.html

jarrodmoldrich avatar Jun 23 '20 07:06 jarrodmoldrich