Skip to content

Commit 3030f6a

Browse files
authored
Merge pull request #7168 from IgniteUI/simeonoff/fix-7167
fix(calendar): add current hover month text color
2 parents 65f60b5 + da6682f commit 3030f6a

File tree

3 files changed

+30
-14
lines changed

3 files changed

+30
-14
lines changed

projects/igniteui-angular/src/lib/core/styles/components/calendar/_calendar-component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
&:hover,
178178
&:focus {
179179
@extend %cal-value--month-hover !optional;
180-
@extend %cal-value--month-current !optional;
180+
@extend %cal-value--month-current-hover !optional;
181181
}
182182
}
183183

projects/igniteui-angular/src/lib/core/styles/components/calendar/_calendar-theme.scss

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@
3535
/// @param {Color} $weekend-text-color [null] - The text color for weekend days.
3636
///
3737
/// @param {Color} $year-current-text-color [null] - The text color for the current/selected year.
38-
/// @param {Color} $month-current-text-color [null]- The text color for the current/selected month.
3938
///
40-
/// @param {Color} $year-hover-text-color [null] - The year hover text color.
39+
/// @param {Color} $month-current-text-color [null]- The text color for the current/selected month.
40+
/// @param {Color} $month-hover-current-text-color [null]- The text color for the current/selected month on hover.
4141
/// @param {Color} $month-hover-text-color [null] - The month hover text color.
4242
/// @param {Color} $month-hover-background [null] - The month hover background color.
43+
/// @param {border-radius} $month-border-radius [null] - The border radius used for the outline outline of the month.
44+
///
45+
/// @param {Color} $year-hover-text-color [null] - The year hover text color.
4346
///
4447
/// @param {Color} $date-selected-background [null] - The background color for the selected date.
4548
/// @param {Color} $date-selected-text-color [null] - The text color for the selected date.
@@ -56,7 +59,6 @@
5659
///
5760
/// @param {border-radius} $border-radius [null] - The border radius used for the outline of the calendar.
5861
/// @param {border-radius} $date-border-radius [null] - The border radius used for the outline outline of the date.
59-
/// @param {border-radius} $month-border-radius [null] - The border radius used for the outline outline of the month.
6062
///
6163
/// @requires $default-palette
6264
/// @requires $light-schema
@@ -100,6 +102,7 @@
100102
101103
$year-hover-text-color: null,
102104
$month-hover-text-color: null,
105+
$month-hover-current-text-color: null,
103106
$month-hover-background: null,
104107
105108
$date-selected-background: null,
@@ -239,17 +242,15 @@
239242
$date-special-text-color: text-contrast($date-special-background);
240243
}
241244

242-
@if $not-bootstrap-theme {
243-
@if not($month-hover-text-color) and $content-background{
244-
@if type-of($content-background) == 'color' {
245-
$month-hover-text-color: text-contrast($content-background);
246-
}
245+
@if not($month-hover-text-color) and $month-hover-background {
246+
@if type-of($month-hover-background) == 'color' {
247+
$month-hover-text-color: text-contrast($month-hover-background);
247248
}
248249
}
249250

250-
@if not($month-hover-text-color) and $month-hover-background {
251-
@if type-of($month-hover-text-color) == 'color' {
252-
$month-hover-text-color: text-contrast($month-hover-background);
251+
@if not($month-hover-current-text-color) and $month-hover-background {
252+
@if type-of($month-hover-background) == 'color' {
253+
$month-hover-current-text-color: text-contrast($month-hover-background);
253254
}
254255
}
255256

@@ -289,6 +290,7 @@
289290

290291
year-hover-text-color: $year-hover-text-color,
291292
month-hover-text-color: $month-hover-text-color,
293+
month-hover-current-text-color: $month-hover-current-text-color,
292294
month-hover-background: $month-hover-background,
293295

294296
date-selected-background: $date-selected-background,
@@ -746,6 +748,10 @@
746748
color: --var($theme, 'month-current-text-color');
747749
}
748750

751+
%cal-value--month-current-hover {
752+
color: --var($theme, 'month-hover-current-text-color');
753+
}
754+
749755
%cal-value--inactive {
750756
cursor: pointer;
751757
color: --var($theme, 'inactive-text-color');

projects/igniteui-angular/src/lib/core/styles/themes/schemas/light/_calendar.scss

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
/// @prop {Map} year-current-text-color [igx-color: ('secondary', 500)] - The text color for the current/selected year.
2727
/// @prop {Map} year-hover-text-color [igx-color: ('secondary', 500)] - The year hover text color.
2828
///
29-
/// @prop {Map} month-current-text-color [igx-color: ('secondary', 500)]- The text color for the current/selected month.
3029
/// @prop {Map} month-hover-text-color [igx-color: 'surface', text-contrast: ()] - The month hover text color.
3130
/// @prop {Map} month-hover-background [igx-color: ('grays', 200)] - The month hover text color.
31+
/// @prop {Map} month-current-text-color [igx-color: ('secondary', 500)]- The text color for the current/selected month.
32+
/// @prop {Map} month-hover-current-text-color [igx-color: ('secondary', 500)]- The text color for the current/selected month on hover.
33+
/// @prop {Number} month-border-radius [1] - The border radius fraction, between 0-1 to be used for calendar.
3234
///
3335
/// @prop {Map} date-selected-background [igx-color: ('secondary', 500)] - The background color for the selected date.
3436
/// @prop {Map} date-selected-text-color [igx-contrast-color: ('secondary', 500)] - The text color for the selected date.
@@ -49,7 +51,6 @@
4951
///
5052
/// @prop {Number} border-radius [.2] - The border radius fraction, between 0-1 to be used for calendar.
5153
/// @prop {Number} date-border-radius [1] - The border radius fraction, between 0-1 to be used for calendar.
52-
/// @prop {Number} month-border-radius [1] - The border radius fraction, between 0-1 to be used for calendar.
5354
/// @requires {function} extend
5455
/// @requires {map} $_default-shape-calendar
5556
/// @see $default-palette
@@ -130,6 +131,10 @@ $_light-calendar: extend(
130131
igx-color: ('secondary', 500)
131132
),
132133

134+
month-hover-current-text-color: (
135+
igx-color: ('secondary', 500)
136+
),
137+
133138
year-hover-text-color: (
134139
igx-color: ('secondary', 500)
135140
),
@@ -223,6 +228,7 @@ $_fluent-calendar: extend(
223228
/// @prop {Map} date-special-background [igx-color: ('warn'), rgba:.5] - The background color used for special dates.
224229
///
225230
/// @prop {Map} month-hover-text-color [igx-color: ('primary', 500)] - The month hover text color.
231+
/// @prop {Map} month-hover-current-text-color [igx-color: ('primary', 500)] - The current month hover text color.
226232
/// @prop {Map} month-hover-background [igx-color: ('grays', 100)] - The month hover text color.
227233
///
228234
/// @prop {Map} picker-text-hover-color [igx-color: ('primary', 500)]- The hover picker month/year color.
@@ -272,6 +278,10 @@ $_bootstrap-calendar: extend(
272278
igx-color: ('primary', 500)
273279
),
274280

281+
month-hover-current-text-color: (
282+
igx-color: ('primary', 500)
283+
),
284+
275285
month-hover-background: (
276286
igx-color: ('grays', 100)
277287
),

0 commit comments

Comments
 (0)