twinssbc / Ionic2-Calendar

A calendar component based on Ionic framework
https://ionic-calendar-demo.stackblitz.io
MIT License
388 stars 199 forks source link

.monthview-primary-with-event does not overwrite #598

Open JanDa-ma opened 3 years ago

JanDa-ma commented 3 years ago

I tried to change the display colour of the events that contain events. I'm using like in the documentation the .monthview-primary-with-event class to change it but it does not overwrite it. I don't know if it matters but I use also a template for the events that contain events. This is my code: tab1.page.html

    <ng-template #template let-view="view" let-row="row" let-col="col">
      <div
        *ngIf="dayHasEvents(view.dates[row*7+col]); then thenBlock else elseBlock"
      ></div>
      <ng-template #thenBlock>
        <div class="dayWithEvents">
          <u> {{view.dates[row*7+col].label}} </u>
        </div></ng-template
      >
      <ng-template #elseBlock>{{view.dates[row*7+col].label}}</ng-template>
    </ng-template>

Tab1.page.sccs .monthview-primary-with-event { background-color: #ffffff; }

twinssbc commented 3 years ago

@JanDa-ma Same as https://github.com/twinssbc/Ionic2-Calendar/issues/599, Angular has the concept called View Encapsulation, which may add extra constraint to the CSS class. So you may want to add your style in the global.scss and append !important to see if it will take effect.