I want to change the shape of selecting and hovering on any date to square instead of circle
Asked
Active
Viewed 173 times
1 Answers
1
It is quite tricky the first time. For the hover effect:
.mat-calendar-body-cell {
&:not(.mat-calendar-body-disabled) {
&:hover {
>.mat-calendar-body-cell-content {
&:not(.mat-calendar-body-selected) {
&:not(.mat-calendar-body-comparison-identical) {
// add your styles here
}
}
}
}
}
}
CSS:
.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover >
.mat-calendar-body-cell-content:not(.mat-calendar-body-
selected):not(.mat-calendar-body-comparison-identical) {
// your styles here
}
For the selected day:
.mat-calendar-body-selected {
// add your styles here
}
And in case you need it, for the circle that shows the day you are in:
.mat-calendar-body-today {
&:not(.mat-calendar-body-selected) {
&:not(.mat-calendar-body-comparison-identical) {
// add your styles here
}
}
}
CSS:
.mat-calendar-body-today:not(.mat-calendar-body-selected):not(.mat-
calendar-body-comparison-identical) {
// your styles here
}

AhmedSHA256
- 525
- 2
- 20
-
thanks but i need a css, how to change it from circle to square – Dante Mar 16 '23 at 08:36
-
done @Dante try it please – AhmedSHA256 Mar 16 '23 at 08:40
-
can you suggest me a styles what you are using for that i cant see here – Dante Mar 16 '23 at 08:56
-
I dont really know what you want to do, use the element inspector in chrome and modify the element as you need – AhmedSHA256 Mar 16 '23 at 10:01
-
hey can you please give me one more help i didnt able to change the color of preselected today date it I want to change it, it come up as permanetly – Dante Mar 17 '23 at 09:43
-
Perfect! This works! – chitgoks Aug 01 '23 at 04:13