From 83c470d1802dc23efc015cad5cb3fcef83af7660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20S=C3=A4ume?= Date: Thu, 9 Jan 2025 03:46:35 +0100 Subject: [PATCH] Fix: Add Warn/Error/Abort Theming --- src/app/app.config.ts | 4 +++- src/styles.scss | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/app/app.config.ts b/src/app/app.config.ts index 869359e..a03b899 100644 --- a/src/app/app.config.ts +++ b/src/app/app.config.ts @@ -1,5 +1,6 @@ import {provideHttpClient} from '@angular/common/http'; import {ApplicationConfig, provideZoneChangeDetection} from '@angular/core'; +import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; import {provideAnimationsAsync} from '@angular/platform-browser/animations/async'; import {provideRouter} from '@angular/router'; import {routes} from '@app/app.routes'; @@ -26,6 +27,7 @@ export const appConfig: ApplicationConfig = { useRefreshToken: true, logLevel: LogLevel.Error, }, - }) + }), + { provide: MAT_FORM_FIELD_DEFAULT_OPTIONS, useValue: { appearance: 'outline' } } ], }; diff --git a/src/styles.scss b/src/styles.scss index a03f579..141b522 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -27,3 +27,17 @@ app-root { flex-direction: column; align-items: center; } + +button { + &.abort, &.error, &.warn { + @include mat.button-overrides(( + text-label-text-color: var(--mat-sys-error), + text-ripple-color: var(--mat-sys-error), + text-state-layer-color: var(--mat-sys-error), + filled-label-text-color: var(--mat-sys-on-error), + filled-container-color: var(--mat-sys-error), + filled-ripple-color: var(--mat-sys-on-error), + filled-state-layer-color: var(--mat-sys-on-error), + )); + } +}