From bb74dbf9a0ce045242ef00665c2f87dc415bf315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Mah=C3=A9?= Date: Wed, 15 Apr 2020 16:58:50 +0200 Subject: [PATCH] [ACA-2476] Fix color contrast in mat-calendar (#5609) --- lib/core/styles/_index.scss | 2 ++ lib/core/styles/_mixins.scss | 55 ++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/lib/core/styles/_index.scss b/lib/core/styles/_index.scss index 31c2d61ea6..8db9b4d30c 100644 --- a/lib/core/styles/_index.scss +++ b/lib/core/styles/_index.scss @@ -74,5 +74,7 @@ @include adf-clipboard-theme($theme); @include adf-snackbar-theme($theme); @include mat-expansion-panel-theme--fix($theme); + @include mat-calendar-theme--fix($theme); + @include mat-datetimepicker-theme--fix($theme); @include adf-search-text-input-theme($theme); } diff --git a/lib/core/styles/_mixins.scss b/lib/core/styles/_mixins.scss index 1e26f473b4..590c79d0de 100644 --- a/lib/core/styles/_mixins.scss +++ b/lib/core/styles/_mixins.scss @@ -80,3 +80,58 @@ } } } + +@mixin mat-calendar-theme--fix($theme) { + $foreground: map-get($theme, foreground); + + .mat-calendar { + .mat-calendar-header { + button { + color: mat-color($foreground, text, 0.87); + + &:disabled { + color: mat-color($foreground, text, 0.54); + } + } + } + .mat-calendar-content { + .mat-calendar-table-header th { + color: mat-color($foreground, text, 0.54); + } + + .mat-calendar-body-disabled > div { + color: mat-color($foreground, text, 0.54) !important; + } + } + } +} + +@mixin mat-datetimepicker-theme--fix($theme) { + $foreground: map-get($theme, foreground); + + .mat-datetimepicker-calendar { + .mat-datetimepicker-calendar-header { + .mat-datetimepicker-calendar-header-year { + opacity: 1; + } + + .mat-datetimepicker-calendar-header-date { + opacity: 1; + } + + .mat-datetimepicker-calendar-header-time { + opacity: 1; + } + } + + .mat-datetimepicker-calendar-content { + .mat-datetimepicker-calendar-table-header th { + color: mat-color($foreground, text, 0.54); + } + + .mat-datetimepicker-calendar-body-disabled > div { + color: mat-color($foreground, text, 0.54); + } + } + } +}