Skip to content

Commit

Permalink
style focused item in menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Aug 27, 2024
1 parent 13d5d7d commit c1883c3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/components/SideMenu/SideMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
class="w-72 overflow-y-auto border-e border-s border-light bg-secondary"
@update:expanded-keys="(...args) => emit('update:expandedKeys', ...args)"
>
<template #item="{item, active, hasSubmenu}">
<template #item="{item, active, hasSubmenu, props}">
<a
:class="getButtonStyles(item)"
:class="{...getButtonStyles(item), [props?.action?.class || '']: true}"
:href="item.link"
tabindex="-1"
@click="handleClick(item)"
Expand Down Expand Up @@ -110,6 +110,10 @@ function mapItems(_items, level = 1) {
const items = computed(() => mapItems(props.items));
const navigationStyling = {
header: {
class: ['focus-visible:border-dark focus-visible:border'],
},
headerContent: () => {
return {
class: [
Expand All @@ -119,6 +123,13 @@ const navigationStyling = {
],
};
},
itemLink: ({context}) => ({
class: [
{
'border border-dark': context.focused,
},
],
}),
itemContent: {
class: ['transition-shadow duration-200'],
},
Expand Down

0 comments on commit c1883c3

Please sign in to comment.