Search code examples
angularcolorspaginationcustomization

How to customize <pagination-controls> color?


I am using angular pagination and I want to customize this blue color into another , Can anyone help me.

enter image description here

I have tried below code stuff also, but it didn't work for me. Below one from this link >>> " https://www.npmjs.com/package/ngx-pagination"

  // head
<style>
  .my-pagination /deep/ .ngx-pagination .current {
    background: red;
  }
</style>

// body
<pagination-controls class="my-pagination"><pagination-controls>

Solution

  • You could try to assign the color for the following selectors

    ::ng-deep ul > li:not(.active) > a {
      background-color: red !important;
      border-color: black !important;
    }
    
    ::ng-deep ul > li.disabled > span {
      background-color: brown !important;
      border-color: black !important;
    }
    
    ::ng-deep ul > li.active > a {
      background-color: green !important;
      border-color: red !important;
    }
    

    Working example: Stackblitz