Skip to content

color theme (red)

Keke edited this page May 14, 2021 · 23 revisions

Put CSS to the stylesData option like below. It is also possible to create a new color theme based on the template below. Change any style defined here.

Color themes:

Other

Try above color themes here.

<input angular-mydatepicker [(ngModel)]="model" [options]="myDatePickerOptions" 
    #dp="angular-mydatepicker">
import {IAngularMyDpOptions} from 'angular-mydatepicker';

export class MyApp {
    myDatePickerOptions: IAngularMyDpOptions = {
      stylesData: {
        selector: 'dp1',
        styles: `
          .dp1 .myDpIconLeftArrow,
          .dp1 .myDpIconRightArrow,
          .dp1 .myDpHeaderBtn {
              color: #B22222;
           }
          .dp1 .myDpHeaderBtn:focus,
          .dp1 .myDpMonthLabel:focus,
          .dp1 .myDpYearLabel:focus {
              color: #FF6347;
           }
          .dp1 .myDpDaycell:focus,
          .dp1 .myDpMonthcell:focus,
          .dp1 .myDpYearcell:focus {
              box-shadow: inset 0 0 0 1px #FF6347;
           }
          .dp1 .myDpSelector:focus {
              box-shadow: -1px 1px 6px 0px #F9CCCC;
           }
          .dp1 .myDpSelectorArrow:focus:before {
              border-bottom-color: #F9CCCC;
           }
          .dp1 .myDpCurrMonth,
          .dp1 .myDpMonthcell,
          .dp1 .myDpYearcell {
              color: #B22222;
              font-weight: bold;
          }
          .dp1 .myDpDaycellWeekNbr {
              color: #B22222;
          }
          .dp1 .myDpPrevMonth,
          .dp1 .myDpNextMonth {
              color: #F08080;
          }
          .dp1 .myDpWeekDayTitle {
              background-color: transparent;
              color: #B22222;
              font-weight: bold;
          }
          .dp1 .myDpHeaderBtnEnabled:hover,
          .dp1 .myDpMonthLabel:hover,
          .dp1 .myDpYearLabel:hover,
          .dp1 .myDpFooterBtn:hover {
              color: #F08080;
          }
          .dp1 .myDpMarkCurrDay, 
          .dp1 .myDpMarkCurrMonth, 
          .dp1 .myDpMarkCurrYear {
              border-bottom: 2px solid #800000;
          }
          .dp1 .myDpDisabled {
              color: #999;
          }
          .dp1 .myDpHighlight {
              color: #FF0000;
          }
          .dp1 .myDpTableSingleDay:hover, 
          .dp1 .myDpTableSingleMonth:hover, 
          .dp1 .myDpTableSingleYear:hover {
              background-color: #F6B2B2;
              color: #800000;
          }
          .dp1 .myDpRangeColor {
              background-color: #FFE1E6;
          }
          .dp1 .myDpSelectedDay,
          .dp1 .myDpSelectedMonth,
          .dp1 .myDpSelectedYear {
              background-color: #E6ADAD;
              color: #800000;
          }
         `
      }
        // other options here
    }

    constructor() {}
}