Skip to content

color theme (green)

Keke edited this page May 14, 2021 · 21 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: #228B22;
            }
           .dp1 .myDpHeaderBtn:focus,
           .dp1 .myDpMonthLabel:focus,
           .dp1 .myDpYearLabel:focus {
               color: #8FBC8F;
            }
           .dp1 .myDpDaycell:focus,
           .dp1 .myDpMonthcell:focus,
           .dp1 .myDpYearcell:focus {
               box-shadow: inset 0 0 0 1px #8FBC8F;
            }
           .dp1 .myDpSelector:focus {
               box-shadow: -1px 1px 6px 0px #B0D0B0;
            }
           .dp1 .myDpSelectorArrow:focus:before {
               border-bottom-color: #B0D0B0;
            }
           .dp1 .myDpCurrMonth,
           .dp1 .myDpMonthcell,
           .dp1 .myDpYearcell {
               color: #228B22;
               font-weight: bold;
            }
           .dp1 .myDpDaycellWeekNbr {
               color: #228B22;
            }
           .dp1 .myDpPrevMonth,
           .dp1 .myDpNextMonth {
               color: #8FBC8F;
            }
           .dp1 .myDpWeekDayTitle {
               background-color: transparent;
               color: #228B22;
               font-weight: bold;
            }
           .dp1 .myDpHeaderBtnEnabled:hover,
           .dp1 .myDpMonthLabel:hover,
           .dp1 .myDpYearLabel:hover,
           .dp1 .myDpFooterBtn:hover {
               color: #90EE90;
            }
           .dp1 .myDpMarkCurrDay, 
           .dp1 .myDpMarkCurrMonth, 
           .dp1 .myDpMarkCurrYear {
               border-bottom: 2px solid #228B22;
            }
           .dp1 .myDpDisabled {
               color: #999;
            }
           .dp1 .myDpHighlight {
               color: #cd5c5c;
            }
           .dp1 .myDpTableSingleDay:hover, 
           .dp1 .myDpTableSingleMonth:hover, 
           .dp1 .myDpTableSingleYear:hover {
               background-color: #90EE90;
            }
           .dp1 .myDpRangeColor {
               background-color: #D1F8D1;
            }
           .dp1 .myDpSelectedDay,
           .dp1 .myDpSelectedMonth,
           .dp1 .myDpSelectedYear {
               background-color: #00FA9A;
            }
         `
      }
        // other options here
    }

    constructor() {}
}