Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change ionic slider pager dots/circles color when active to yellow and inactive to white?

So I have this slide-box, as you can see the pager dots/circles appear without me needing to include <ion-slide-pager></ion-slide-pager>:

  <ion-slide-box>

    <ion-slide>
      <div class="slide-wrapper">

        <img class="slider-img" src="../../img/icons/corazonesfera.png"/>

        <h2>SUBTITULO 1</h2>

        <p>
          Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
          industry's dummy text of the printing dummy text of

        </p>

      </div>
    </ion-slide>

    <ion-slide>
      <div class="slide-wrapper">

        <img class="slider-img" src="../../img/icons/corazonesfera.png"/>

        <h2>SUBTITULO 2</h2>

        <p>
          Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
          industry's    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
          industry's

        </p>

      </div>
    </ion-slide>

    <ion-slide>
      <div class="slide-wrapper">

        <img class="slider-img" src="../../img/icons/corazonesfera.png"/>

        <h2>SUBTITULO 3</h2>

        <p>
          Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
          industry's
          standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it
          to make a
          type specimen book. It has survived not only five centuries, but also the leap into electronic

        </p>

      </div>
    </ion-slide>

  </ion-slide-box>

And it gives me this view:

enter image description here

I tried inserting <ion-slide-pager></ion-slide-pager> between ion-slide-box and ion-slide just like in this tutorial

<ion-slide-pager></ion-slide-pager>
    <ion-slide>
        ...
    </ion-slide>

    <ion-slide>
       ...
    </ion-slide>

But this just messes my view and adds a 4th dot/pager I have no idea where it comes from:

enter image description here

What I need:

I need to change pager dots when active to yellow and when inactive to white, just like this:

enter image description here

UPDATE + ANSWER

Ok finally got it working thanks to the input of users below here is the working Css:

.slider-pager-page {
  color: white !important;
}

.slider-pager-page.active {
  color: $golden-color !important;
}
like image 870
CommonSenseCode Avatar asked Sep 03 '15 14:09

CommonSenseCode


1 Answers

For those using Ionic 4, you'll need to set the color within ion-slides like so:

ion-slides {
   --bullet-background: white;
   --bullet-background-active: yellow;
}

Further details can be found in the docs

like image 157
Cortney Thomas Avatar answered Sep 18 '22 15:09

Cortney Thomas