Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resize ion-spinner

I'm using ion-spinner in a ionic application. But im my case i want to change the size of the spinner. When i use custom css with default spinner Resizing works fine. But with Bubbles,Circles, Dots spinners, it doesn't work properly.
CSS

.spinner-large {
  width: 100px;
  height: 100px;
}

HTML

    <ion-spinner name="dots" class="spinner-large"></ion-spinner>

how can i fix this.

Stackblitz example

like image 781
Lahiru Mirihagoda Avatar asked Jan 03 '20 11:01

Lahiru Mirihagoda


People also ask

How do you use an ion spinner?

The default spinner to use is based on the platform. The default spinner for ios is "lines" , and the default for android is "crescent" . If the platform is not ios or android , the spinner will default to crescent . If the name property is set, then that spinner will be used instead of the platform specific spinner.


3 Answers

Try using

ion-spinner {
    transform: scale(3);
}

From ionic forum its mentioned that this will make you loose some resolution.

like image 181
Nitheesh Avatar answered Nov 03 '22 14:11

Nitheesh


As Ionic 4, you can use width & height:

ion-spinner {
  width: 3em;
  height: 3em;
}

https://github.com/ionic-team/ionic-framework/issues/18115

like image 24
nelson6e65 Avatar answered Nov 03 '22 14:11

nelson6e65


I ran into a similar styling issue and to resolve it I needed to add position: absolute to css rules

like image 36
brooklynDadCore Avatar answered Nov 03 '22 16:11

brooklynDadCore