From b39a5563a63e5a527e1a8aa847b28ad6a5130803 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 23 Jul 2024 13:05:11 -0400 Subject: [PATCH] fix(components): background styles to selected nav item --- libs/components/src/app-shell/app-shell.scss | 6 ++++++ libs/components/src/list/nav-list-item.scss | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/libs/components/src/app-shell/app-shell.scss b/libs/components/src/app-shell/app-shell.scss index 1ba6859eea..9c72a786bc 100644 --- a/libs/components/src/app-shell/app-shell.scss +++ b/libs/components/src/app-shell/app-shell.scss @@ -16,6 +16,8 @@ --cv-list-item-graphic-margin-left: 0; --cv-list-menu-height: 0; --cv-list-item-expansion-icon-size: 0; + --cv-list-item-selected-background-color: var(--cv-theme-primary-24); + --cv-list-item-selected-color: var(--cv-theme-primary); } :host([open]) .navigation { @@ -27,6 +29,10 @@ --cv-list-item-expansion-icon-margin: -24px; --cv-list-item-expansion-icon-size: 24px; --cv-list-menu-height: inherit; + --cv-list-item-selected-background-color: var( + --cv-theme-on-surface-variant-8 + ); + --cv-list-item-selected-color: var(--cv-theme-on-surface-variant); } :host([helpOpen]) { diff --git a/libs/components/src/list/nav-list-item.scss b/libs/components/src/list/nav-list-item.scss index 4627507ebe..54a1fc8340 100644 --- a/libs/components/src/list/nav-list-item.scss +++ b/libs/components/src/list/nav-list-item.scss @@ -23,6 +23,16 @@ } } +:host([selected]:not([activated])) .expansion-header { + transition: background-color 250ms ease-in, color 250ms ease-in; + background-color: var(--cv-list-item-selected-background-color); + color: var(--cv-list-item-selected-color); + + .mdc-deprecated-list-item__graphic { + --mdc-theme-text-icon-on-background: var(--cv-list-item-selected-color); + } +} + :host([subnav]) { height: 32px; font-weight: var(--mdc-typography-body2-font-weight);