|
1 | 1 | @use "layout.scss"; |
2 | 2 | @use "igniteui-angular/theming" as *; |
3 | 3 |
|
4 | | -$custom-calendar-theme: calendar-theme( |
5 | | - $header-background: #ecaa53, |
6 | | - $content-background: #011627, |
7 | | -); |
| 4 | +// CSS variables approach |
8 | 5 |
|
9 | | -@include css-vars($custom-calendar-theme); |
| 6 | +:host { |
| 7 | + ::ng-deep { |
| 8 | + .igx-days-view__date--weekend:not(.igx-days-view__date--inactive) { |
| 9 | + --date-hover-background: var(--background-hover); |
| 10 | + --date-selected-foreground: var(--primary); |
| 11 | + --date-selected-background: #FFF; |
| 12 | + --date-selected-border-color: var(--primary); |
| 13 | + --date-selected-focus-foreground: var(--primary); |
| 14 | + --date-selected-focus-background: var(--background-hover); |
| 15 | + --date-selected-focus-border-color: var(--primary); |
| 16 | + --date-selected-hover-foreground: var(--primary); |
| 17 | + --date-selected-hover-background: var(--background-hover); |
| 18 | + --date-selected-hover-border-color: var(--primary); |
| 19 | + --date-selected-current-hover-background: var(--background-hover); |
| 20 | + --date-selected-current-focus-background: var(--background-hover); |
| 21 | + --date-selected-current-background: #FFF; |
| 22 | + --date-selected-current-border-color: var(--primary); |
| 23 | + --date-selected-current-hover-border-color: var(--primary); |
| 24 | + --date-current-hover-background: var(--background-hover); |
| 25 | + } |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +igx-calendar { |
| 30 | + --date-focus-background: transparent; |
| 31 | + --week-number-background: transparent; |
| 32 | + --weekend-color: #131E29; |
| 33 | + --weekday-color: #556B82; |
| 34 | + --week-number-foreground: #556B82; |
| 35 | + --inactive-color: #556B82; |
| 36 | + --date-current-border-color: var(--current-border); |
| 37 | + --date-current-hover-border-color: var(--current-border); |
| 38 | + --date-current-focus-border-color: var(--current-border); |
| 39 | + --date-current-hover-background: var(--background-weekend); |
| 40 | + --date-selected-current-border-color: var(--current-border); |
| 41 | + --date-selected-current-background: #FFF; |
| 42 | + --date-selected-current-foreground: var(--primary); |
| 43 | + --date-selected-current-focus-border-color: var(--current-border); |
| 44 | + --date-selected-current-focus-background: var(--background-weekend); |
| 45 | + --date-selected-current-focus-foreground: var(--primary); |
| 46 | + --date-selected-current-hover-border-color: var(--current-border); |
| 47 | + --date-selected-current-hover-background: var(--background-weekend); |
| 48 | + --date-selected-current-hover-foreground: var(--primary); |
| 49 | + --date-selected-foreground: var(--primary); |
| 50 | + --date-selected-background: #FFF; |
| 51 | + --date-selected-border-color: var(--primary); |
| 52 | + --date-selected-hover-foreground: var(--primary); |
| 53 | + --date-selected-hover-background: var(--background-weekend); |
| 54 | + --date-selected-hover-border-color: var(--primary); |
| 55 | + --date-selected-focus-foreground: var(--primary); |
| 56 | + --date-selected-focus-background: var(--background-weekend); |
| 57 | + --date-selected-focus-border-color: var(--primary); |
| 58 | + --picker-foreground: var(--primary); |
| 59 | + --picker-hover-foreground: var(--primary); |
| 60 | + --picker-focus-foreground: var(--primary); |
| 61 | + --ym-hover-background: var(--background); |
| 62 | + --ym-selected-background: #EDF5FF; |
| 63 | + --ym-selected-hover-background: #D9EAFF; |
| 64 | + --ym-selected-hover-foreground: var(--primary); |
| 65 | + --ym-selected-outline-color: var(--primary); |
| 66 | + --ym-selected-hover-outline-color: var(--primary); |
| 67 | + --ym-selected-focus-outline-color: var(--primary); |
| 68 | + --ym-selected-focus-background: #D9EAFF; |
| 69 | + --ym-current-foreground: var(--primary); |
| 70 | + --ym-current-background: transparent; |
| 71 | + --ym-current-outline-color: transparent; |
| 72 | + --ym-current-hover-foreground: var(--primary); |
| 73 | + --ym-current-hover-background: var(--background); |
| 74 | + --ym-current-outline-hover-color: var(--primary); |
| 75 | + --ym-selected-current-foreground: var(--primary); |
| 76 | + --ym-selected-current-background: #EDF5FF; |
| 77 | + --ym-selected-current-outline-color: var(--primary); |
| 78 | + --ym-selected-current-hover-foreground: var(--primary); |
| 79 | + --ym-selected-current-hover-background: #D9EAFF; |
| 80 | + --ym-selected-current-outline-hover-color: var(--primary); |
| 81 | + --ym-selected-current-outline-focus-color: var(--primary); |
| 82 | +} |
| 83 | + |
| 84 | +// Sass theme approach |
| 85 | + |
| 86 | +// $custom-calendar-theme-weekend: calendar-theme( |
| 87 | +// $date-hover-background: var(--background-hover), |
| 88 | +// $date-selected-foreground: var(--primary), |
| 89 | +// $date-selected-background: #FFF, |
| 90 | +// $date-selected-border-color: var(--primary), |
| 91 | +// $date-selected-focus-foreground: var(--primary), |
| 92 | +// $date-selected-focus-background: var(--background-hover), |
| 93 | +// $date-selected-focus-border-color: var(--primary), |
| 94 | +// $date-selected-hover-foreground: var(--primary), |
| 95 | +// $date-selected-hover-background: var(--background-hover), |
| 96 | +// $date-selected-hover-border-color: var(--primary), |
| 97 | +// $date-selected-current-hover-background: var(--background-hover), |
| 98 | +// $date-selected-current-focus-background: var(--background-hover), |
| 99 | +// $date-selected-current-background: #FFF, |
| 100 | +// $date-selected-current-border-color: var(--primary), |
| 101 | +// $date-selected-current-hover-border-color: var(--primary), |
| 102 | +// $date-current-hover-background: var(--background-hover) |
| 103 | +// ); |
| 104 | + |
| 105 | +// $custom-calendar-theme: calendar-theme( |
| 106 | +// $date-focus-background: transparent, |
| 107 | +// $picker-foreground: var(--primary), |
| 108 | +// $picker-hover-foreground: var(--primary), |
| 109 | +// $picker-focus-foreground: var(--primary), |
| 110 | +// $weekday-color: #556B82, |
| 111 | +// $weekend-color: #131E29, |
| 112 | +// $inactive-color: #556B82, |
| 113 | +// $week-number-foreground: #556B82, |
| 114 | +// $week-number-background: transparent, |
| 115 | +// $ym-selected-current-hover-foreground: var(--primary), |
| 116 | +// $ym-selected-current-hover-background: #D9EAFF, |
| 117 | +// $ym-hover-background: var(--background), |
| 118 | +// $ym-current-foreground: var(--primary), |
| 119 | +// $ym-current-background: transparent, |
| 120 | +// $ym-current-hover-foreground: var(--primary), |
| 121 | +// $ym-current-hover-background: var(--background), |
| 122 | +// $ym-selected-current-foreground: var(--primary), |
| 123 | +// $ym-selected-current-background: #EDF5FF, |
| 124 | +// $ym-selected-background: #EDF5FF, |
| 125 | +// $ym-selected-hover-foreground: var(--primary), |
| 126 | +// $ym-selected-hover-background: #D9EAFF, |
| 127 | +// $ym-current-outline-color: transparent, |
| 128 | +// $ym-current-outline-hover-color: var(--primary), |
| 129 | +// $ym-selected-outline-color: var(--primary), |
| 130 | +// $ym-selected-hover-outline-color: var(--primary), |
| 131 | +// $ym-selected-focus-outline-color: var(--primary), |
| 132 | +// $ym-selected-current-outline-color: var(--primary), |
| 133 | +// $ym-selected-current-outline-hover-color: var(--primary), |
| 134 | +// $ym-selected-current-outline-focus-color: var(--primary), |
| 135 | +// $date-selected-current-foreground: var(--primary), |
| 136 | +// $date-selected-current-background: #FFF, |
| 137 | +// $date-selected-current-hover-foreground: var(--primary), |
| 138 | +// $date-selected-current-hover-background: var(--background-weekend), |
| 139 | +// $date-selected-current-focus-foreground: var(--primary), |
| 140 | +// $date-selected-current-focus-background: var(--background-weekend), |
| 141 | +// $date-selected-foreground: var(--primary), |
| 142 | +// $date-selected-background: #FFF, |
| 143 | +// $date-selected-border-color: var(--primary), |
| 144 | +// $date-selected-hover-foreground: var(--primary), |
| 145 | +// $date-selected-hover-background: var(--background-weekend), |
| 146 | +// $date-selected-hover-border-color: var(--primary), |
| 147 | +// $date-selected-focus-foreground: var(--primary), |
| 148 | +// $date-selected-focus-background: var(--background-weekend), |
| 149 | +// $date-selected-focus-border-color: var(--primary), |
| 150 | +// $date-current-border-color: var(--current-border), |
| 151 | +// $date-current-hover-border-color: var(--current-border), |
| 152 | +// $date-current-focus-border-color: var(--current-border), |
| 153 | +// $date-selected-current-border-color: var(--current-border), |
| 154 | +// $date-selected-current-hover-border-color: var(--current-border), |
| 155 | +// $date-selected-current-focus-border-color: var(--current-border), |
| 156 | +// $date-current-hover-background: var(--background-weekend), |
| 157 | +// $border-radius: 0.5rem, |
| 158 | +// ); |
| 159 | + |
| 160 | +// :host { |
| 161 | +// ::ng-deep { |
| 162 | +// .igx-days-view__date--weekend:not(.igx-days-view__date--inactive) { |
| 163 | +// @include css-vars($custom-calendar-theme-weekend); |
| 164 | +// } |
| 165 | +// } |
| 166 | +// } |
| 167 | + |
| 168 | +// igx-calendar { |
| 169 | +// @include css-vars($custom-calendar-theme); |
| 170 | +// } |
0 commit comments