From 0b98dcb7ac3e86437b433e408e99c0d257503afb Mon Sep 17 00:00:00 2001 From: Daniel Kimmich Date: Thu, 21 Mar 2024 12:18:23 -0400 Subject: [PATCH] fix: respect contrast color of mini FABs --- .../src/lib/_mat-lib-overwrites.scss | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/projects/material-css-vars/src/lib/_mat-lib-overwrites.scss b/projects/material-css-vars/src/lib/_mat-lib-overwrites.scss index 4362530..d74383b 100644 --- a/projects/material-css-vars/src/lib/_mat-lib-overwrites.scss +++ b/projects/material-css-vars/src/lib/_mat-lib-overwrites.scss @@ -19,31 +19,39 @@ // FAB component // --------------------------- @mixin _mat-mdc-fab-overwrites { - $primary: public-util.mat-css-color(500, null, "primary"); - $accent: public-util.mat-css-color(500, null, "accent"); - $warn: public-util.mat-css-color(500, null, "warn"); $primary-contrast: public-util.mat-css-color(500, null, "primary", true); $accent-contrast: public-util.mat-css-color(500, null, "accent", true); $warn-contrast: public-util.mat-css-color(500, null, "warn", true); - .mat-mdc-fab:not(:disabled), - .mat-mdc-mini-fab:not(:disabled) { + .mat-mdc-fab:not(:disabled) { &.mat-primary { - --mdc-fab-container-color: #{$primary}; --mat-fab-foreground-color: #{$primary-contrast}; --mat-fab-state-layer-color: #{$primary-contrast}; } &.mat-accent { - --mdc-fab-container-color: #{$accent}; --mat-fab-foreground-color: #{$accent-contrast}; --mat-fab-state-layer-color: #{$accent-contrast}; } &.mat-warn { - --mdc-fab-container-color: #{$warn}; --mat-fab-foreground-color: #{$warn-contrast}; --mat-fab-state-layer-color: #{$warn-contrast}; } } + + .mat-mdc-mini-fab:not(:disabled) { + &.mat-primary { + --mat-fab-small-foreground-color: #{$primary-contrast}; + --mat-fab-small-state-layer-color: #{$primary-contrast}; + } + &.mat-accent { + --mat-fab-small-foreground-color: #{$accent-contrast}; + --mat-fab-small-state-layer-color: #{$accent-contrast}; + } + &.mat-warn { + --mat-fab-small-foreground-color: #{$warn-contrast}; + --mat-fab-small-state-layer-color: #{$warn-contrast}; + } + } } // ---------------------------