Reputation: 572
How do i change the border radius of react-modal, i have given className Modal
to the component and have defined the styles for the class but that does not seem to have any effect on the modal
<Modal
className='Modal'
isOpen={!!this.props.selectedProject}
contnetLabel='Selected Option'
onRequestClose={this.props.clearProjects}
ariaHideApp={false}
closeTimeoutMS={1000}
>
</Modal>
SASS :
.Modal {
font-family: Raleway;
background-color: #242222;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
height: 90vh;
width: 50vw;
margin-right: -50%;
color: white;
border-radius: 400px;
h3 {
color: white;
}
}
Website link Modal is in my projects section
Upvotes: 2
Views: 7446
Reputation: 51
Here's how I added a border radius to my Modal with Mantine in my React app. Its prop is called "radius"
<Modal opened={opened} onClose={close} radius='40px'>
Upvotes: 0
Reputation: 11
There's a prop called contentClassName add this className with a unique name and in the style sheet, use that name independently as a selector and give the property border-radius : desired px;
here the contentClassName provides the className to modal-content, which covers your whole ModalHeader, body and Footer
for eg.
<Modal contentClassName="custom-modal"></Modal>
style.scss
.custom-modal { border-radius: 10px !important; }
Upvotes: 1
Reputation: 84
You should add overflow property.
.Modal {
...
overflow: hidden;
...
}
Upvotes: 1