Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 3 - Modal screen with rounded corners

How to round a modal screen like this link ?

My CSS code is:

.modal {
   background: rgba(0, 0, 0, 0.5) !important;
   padding: 25% 15%  !important;
   display: block;
   border-radius: 25px;
 }

modal.html

   <ion-content>
     <div class="subtitulo">
       <h4>Select your city</h4>
     </div>

    <ion-list>
      <button ion-item *ngFor="let cidade of cidades" (click)="selCidade(cidade)" detail-none>
        <h3 text-wrap>{{ cidade.nome }}</h3>
        <ion-icon name="ios-arrow-forward" item-right></ion-icon>
      </button>
     </ion-list>
   </ion-content>

But the border-radius have no effect. I tried some tutorials, but no one has effect.

I need some help in CSS for this case

Tks,

like image 349
Murilo Avatar asked Mar 11 '26 17:03

Murilo


1 Answers

Just posting the solution for ionic 4:

in global.scss, just change the scss variable of the ionic component "ion-modal"

ion-modal {
  --border-radius: 8px!important;
}
like image 194
Corentin DUPONT Avatar answered Mar 14 '26 08:03

Corentin DUPONT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!