Skip to content

Commit

Permalink
fix(a11y): contrast for active menubar buttons
Browse files Browse the repository at this point in the history
Dropdown menus (headings and callouts) are still low contrast.

Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Dec 7, 2023
1 parent 60255e9 commit e1afbfe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 24 deletions.
23 changes: 0 additions & 23 deletions src/components/Menu/ActionEntry.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
%text__is-active-item-btn {
opacity: 1;
background-color: var(--color-primary-element-light);
border-radius: 50%;
.material-design-icon > svg {
fill: var(--color-primary-element);
}
}

.text-menubar, .v-popper__inner {
button.entry-action__button {
height: 44px;
Expand Down Expand Up @@ -49,20 +40,6 @@
box-shadow: var(--color-primary-element);
}

&.is-active {
@extend %text__is-active-item-btn;
}
}

.entry-action.is-active:not(.entry-action-item) {
@extend %text__is-active-item-btn;
}

.entry-action.entry-action-item {
&.is-active {
background-color: var(--color-primary-element-light);
border-radius: var(--border-radius-large);
}
}

.button-vue {
Expand Down
3 changes: 3 additions & 0 deletions src/components/Menu/ActionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
v-bind="state"
:container="menuIDSelector"
:aria-label="actionEntry.label"
:aria-pressed="state.active"
:type="state.active ? 'primary': 'tertiary'"
:aria-activedescendant="currentChild ? `${$menuID}-child-${currentChild.key}` : null"
:force-menu="true"
:name="actionEntry.label"
Expand All @@ -39,6 +41,7 @@
<ActionSingle v-for="child in children"
:id="`${$menuID}-child-${child.key}`"
:key="`child-${child.key}`"
:active="currentChild?.key === child.key"
is-item
:action-entry="child"
v-on="$listeners"
Expand Down
5 changes: 4 additions & 1 deletion src/components/Menu/ActionSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,14 @@ export default {
class: classes,
attrs: {
title,
type: 'tertiary',
type: attrs.active ? 'primary' : 'tertiary',
role: 'menuitem',
'data-text-action-entry': actionEntry.key,
...attrs,
},
props: isItem
? { pressed: attrs.active }
: {},
on: {
...$listeners,
click: runAction,
Expand Down

0 comments on commit e1afbfe

Please sign in to comment.