Skip to content

color theme (yellow)

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: #DAA520;
           }
          .dp1 .myDpHeaderBtn:focus,
          .dp1 .myDpMonthLabel:focus,
          .dp1 .myDpYearLabel:focus {
              color: #FFDAB9;
           }
          .dp1 .myDpDaycell:focus,
          .dp1 .myDpMonthcell:focus,
          .dp1 .myDpYearcell:focus {
              box-shadow: inset 0 0 0 1px #F4A460;
          }
          .dp1 .myDpSelector:focus {
              box-shadow: -1px 1px 6px 0px #FADABF;
          }
          .dp1 .myDpSelectorArrow:focus:before {
              border-bottom-color: #FADABF;
          }
          .dp1 .myDpCurrMonth,
          .dp1 .myDpMonthcell,
          .dp1 .myDpYearcell {
              color: #DAA520;
              font-weight: bold;
          }
          .dp1 .myDpDaycellWeekNbr {
              color: #DAA520;
          }
          .dp1 .myDpPrevMonth,
          .dp1 .myDpNextMonth {
              color: #DEB887;
          }
          .dp1 .myDpWeekDayTitle {
              background-color: transparent;
              color: #DAA520;
              font-weight: bold;
          }
          .dp1 .myDpMonthYearSelBar {
              border-bottom: 1px solid #FADABF;
          }
          .dp1 .myDpHeaderBtnEnabled:hover,
          .dp1 .myDpMonthLabel:hover,
          .dp1 .myDpYearLabel:hover,
          .dp1 .myDpFooterBtn:hover {
              color: #F0E68C;
          }
          .dp1 .myDpMarkCurrDay, 
          .dp1 .myDpMarkCurrMonth, 
          .dp1 .myDpMarkCurrYear {
              border-bottom: 2px solid #DAA520;
          }
          .dp1 .myDpDisabled {
              color: #999;
          }
         .dp1 .myDpTableSingleDay:hover, 
         .dp1 .myDpTableSingleMonth:hover, 
         .dp1 .myDpTableSingleYear:hover {
              background-color: #F0E68C;
              color: #DAA520;
         }
         .dp1 .myDpRangeColor {
              background-color: #FFF1DC;
         }
         .dp1 .myDpSelectedDay,
         .dp1 .myDpSelectedMonth,
         .dp1 .myDpSelectedYear {
             background-color: #F0E68C;
            color: #B8860B;
         }
         `
      }
        // other options here
    }

    constructor() {}
}