Looking to customize an HTML element
<div [style.color]="themeService.backgroundColor" class="col-md-10 col-md-offset-1 col-sm-10 col-sm-offset-1 col-lg-10 col-lg-offset-1">
<ul class="pagination" id="pag-bar">
<li class="page-item2" *ngIf="!getStyle(1)">
<span class="spl" id="left-arrow" (click)="decPresentPage()">
<div class="arrow" (click)="decreasePage()">
<
</div>
<div class="side-text">Previous</div>
</span>
</li>
<li class="page-item">
<span class="page-link" href="#" (click)="decPresentPage()">
<div class="page-text prev">S</div>
<br/>
</span>
</li>
<li class="page-item" *ngFor="let num of getNumber(maxPage)">
<span class="page-link" *ngIf="presentPage>=4 && presentPage-3+num<=noOfPages" [class.active_page]="getStyle(presentPage-3+num)"
(click)="getPresentPage(presentPage-3+num)" href="#">
<div [class.active_page]="getStyle(presentPage-3+num)" class="page-text">U</div>
<span class="page-number">{{presentPage-3+num}}</span>
</span>
<span class="page-link" *ngIf="presentPage<4 && num<=noOfPages" [class.active_page]="num+1 == presentPage" (click)="getPresentPage(num+1)"
href="#">
<div [class.active_page]="num+1 == presentPage" class="page-text">U</div>
<span class="page-number">{{num+1}}</span>
</span>
</li>
<li class="page-item">
<span class="page-link" (click)="incPresentPage()">
<div class="page-text next">SPER</div>
</span>
</li>
<div class="next-page-mobile">Page {{count}}</div>
<li class="page-item2" *ngIf="!getStyle(noOfPages)">
<span class="spl" (click)="incPresentPage()">
<div class="arrow" (click)="increasePage()">></div>
<div class="side-text">Next</div>
</span>
</li>
</ul>
</div>
Trying to apply custom styles through a service, but facing issues due to bootstrap classes overriding. Attempted rewriting the bootstrap class in a .css
file with no success. How can I prevent bootstrap from setting the color
style while preserving all other applied styles? Also experimented with changing the style through the theme service by selecting the class element using
(document.getElementsByClassName("pagination")[0] as HTMLElement).style.background = '#373737';
, however, encountered issues with (document.getElementsByClassName("pagination")[0]
being undefined upon page load.