Skip to content

Commit f563acd

Browse files
authored
refactor(calendar): remove unused theme parameters (#15667)
1 parent d01b020 commit f563acd

File tree

3 files changed

+47
-35
lines changed

3 files changed

+47
-35
lines changed

projects/igniteui-angular/migrations/update-19_2_0/changes/theme-changes.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,30 @@
3030
"remove": true,
3131
"owner": "switch-theme",
3232
"type": "property"
33+
},
34+
{
35+
"name": "$date-selected-current-outline",
36+
"remove": true,
37+
"owner": "calendar-theme",
38+
"type": "property"
39+
},
40+
{
41+
"name": "$date-selected-current-hover-outline",
42+
"remove": true,
43+
"owner": "calendar-theme",
44+
"type": "property"
45+
},
46+
{
47+
"name": "$date-selected-current-focus-outline",
48+
"remove": true,
49+
"owner": "calendar-theme",
50+
"type": "property"
51+
},
52+
{
53+
"name": "$date-special-current-border-color",
54+
"remove": true,
55+
"owner": "calendar-theme",
56+
"type": "property"
3357
}
3458
]
3559
}

projects/igniteui-angular/migrations/update-19_2_0/index.spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,27 @@ describe(`Update to ${version}`, () => {
5858
);`
5959
);
6060
});
61+
62+
it('should remove unused properties from the calendar theme', async () => {
63+
const testFilePath = `/testSrc/appPrefix/component/test.component.scss`;
64+
65+
appTree.create(
66+
testFilePath,
67+
`$calendar-theme: calendar-theme(
68+
$date-special-current-border-color: orange,
69+
$date-selected-current-outline: orange,
70+
$date-selected-current-hover-outline: orange,
71+
$date-selected-current-focus-outline: orange,
72+
$content-background: black
73+
);`
74+
);
75+
76+
const tree = await schematicRunner.runSchematic(migrationName, {}, appTree);
77+
78+
expect(tree.readContent(testFilePath)).toEqual(
79+
`$calendar-theme: calendar-theme(
80+
$content-background: black
81+
);`
82+
);
83+
});
6184
});

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

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@
108108
/// @param {Color} $date-selected-current-range-focus-foreground [null] - The :focus foreground of the current date in the selected range.
109109
/// @param {Color} $date-selected-current-range-focus-background [null] - The :focus background of the current date in the selected range.
110110
///
111-
/// @param {Color} $date-selected-current-outline [null] - The outline of the current selected date.
112-
/// @param {Color} $date-selected-current-hover-outline [null] - The :hover outline of the current selected date.
113-
/// @param {Color} $date-selected-current-focus-outline [null] - The :focus outline of the current selected date.
114-
///
115111
/// @param {Color} $date-selected-special-border-color: [null] - The border color of the selected special date,
116112
/// @param {Color} $date-selected-special-hover-border-color: [null] - The :hover border color of the selected special date,
117113
/// @param {Color} $date-selected-special-focus-border-color: [null] - The :focus border color of the selected special date,
@@ -137,8 +133,6 @@
137133
/// @param {Color} $date-special-range-foreground [null] - The foreground of the dates inside a range and marked as special.
138134
/// @param {Color} $date-special-range-border-color [null] - The outline of the dates inside a range and marked as special.
139135
///
140-
/// @param {Color} $date-special-current-border-color [null] - The outline color of a special current date.
141-
///
142136
/// @param {Color} $border-color [null] - The calendar border color.
143137
///
144138
/// @param {Color} $date-border-color [null] - The border color of the date.
@@ -282,10 +276,6 @@
282276
$date-selected-current-hover-border-color: null,
283277
$date-selected-current-focus-border-color: null,
284278
285-
$date-selected-current-outline: null,
286-
$date-selected-current-hover-outline: null,
287-
$date-selected-current-focus-outline: null,
288-
289279
$date-selected-special-border-color: null,
290280
$date-selected-special-hover-border-color: null,
291281
$date-selected-special-focus-border-color: null,
@@ -310,7 +300,6 @@
310300
$date-special-range-focus-background: null,
311301
$date-special-range-foreground: null,
312302
$date-special-range-border-color: null,
313-
$date-special-current-border-color: null,
314303
$date-disabled-foreground: null,
315304
$date-disabled-range-foreground: null,
316305
@@ -400,26 +389,6 @@
400389
}
401390
}
402391

403-
@if $variant == 'material' or $variant == 'indigo' {
404-
@if not($date-selected-current-outline) and $content-background {
405-
@if meta.type-of($content-background) == 'color' {
406-
$date-selected-current-outline: $content-background;
407-
}
408-
}
409-
410-
@if not($date-selected-current-hover-outline) and $content-background {
411-
@if meta.type-of($content-background) == 'color' {
412-
$date-selected-current-hover-outline: $content-background;
413-
}
414-
}
415-
416-
@if not($date-selected-current-focus-outline) and $content-background {
417-
@if meta.type-of($content-background) == 'color' {
418-
$date-selected-current-focus-outline: $content-background;
419-
}
420-
}
421-
}
422-
423392
@if not($content-foreground) and $content-background {
424393
@if meta.type-of($content-background) == 'color' {
425394
$content-foreground: text-contrast($content-background);
@@ -640,10 +609,6 @@
640609
date-selected-current-hover-foreground: $date-selected-current-hover-foreground,
641610
date-selected-current-focus-foreground: $date-selected-current-focus-foreground,
642611

643-
date-selected-current-outline: $date-selected-current-outline,
644-
date-selected-current-hover-outline: $date-selected-current-hover-outline,
645-
date-selected-current-focus-outline: $date-selected-current-focus-outline,
646-
647612
date-selected-special-border-color: $date-selected-special-border-color,
648613
date-selected-special-hover-border-color: $date-selected-special-hover-border-color,
649614
date-selected-special-focus-border-color: $date-selected-special-focus-border-color,

0 commit comments

Comments
 (0)