diff --git a/changelog/unreleased/bugfix-nav-primary-button-hover-contrast.md b/changelog/unreleased/bugfix-nav-primary-button-hover-contrast.md new file mode 100644 index 00000000000..6fe2547fdd1 --- /dev/null +++ b/changelog/unreleased/bugfix-nav-primary-button-hover-contrast.md @@ -0,0 +1,12 @@ +Bugfix: fixed low color contrast on nav and primary button hover states + +Non-active sidebar navigation items, as well as buttons using the +"primary" styling, showed their text and icons in black on top of a +dark hover background in some themes, making them hard to read while +hovering. + +The hover state for these elements now switches to a light color +instead of always using black, restoring readable contrast between +the text and the background while hovering. + +https://github.com/owncloud/ocis/pull/12993 diff --git a/web/packages/design-system/src/components/OcButton/OcButton.vue b/web/packages/design-system/src/components/OcButton/OcButton.vue index 7af4584592f..e74187cac08 100644 --- a/web/packages/design-system/src/components/OcButton/OcButton.vue +++ b/web/packages/design-system/src/components/OcButton/OcButton.vue @@ -394,6 +394,17 @@ const handlers = computed(() => { fill: var(--oc-color-swatch-primary-contrast) !important; } } + + &-filled:hover:not([disabled]), + &-filled:focus:not([disabled]), + &-outline:hover:not([disabled]), + &-outline:focus:not([disabled]) { + color: var(--oc-color-text-inverse) !important; + + span > svg { + fill: var(--oc-color-text-inverse) !important; + } + } } &-success { diff --git a/web/packages/web-runtime/src/components/SidebarNav/SidebarNavItem.vue b/web/packages/web-runtime/src/components/SidebarNav/SidebarNavItem.vue index c4c422b3314..6c37daf9c30 100644 --- a/web/packages/web-runtime/src/components/SidebarNav/SidebarNavItem.vue +++ b/web/packages/web-runtime/src/components/SidebarNav/SidebarNavItem.vue @@ -119,10 +119,10 @@ export default defineComponent({ &:hover:not(.active) { background-color: var(--oc-color-swatch-primary-hover) !important; - color: var(--oc-color-swatch-primary-contrast) !important; + color: var(--oc-color-text-inverse) !important; .oc-icon > svg { - fill: var(--oc-color-swatch-primary-contrast); + fill: var(--oc-color-text-inverse); } }