88 class =" app-item"
99 :class =" {
1010 'app-item--active': app.active,
11- 'app-item--outlined': outlined,
1211 }"
1312 :href =" app.href"
1413 :target =" newTab ? '_blank' : undefined"
1716 :tabindex =" tabindex"
1817 :title =" app.name"
1918 role =" menuitem" >
20- <span class =" app-item__circle" >
21- <img
22- class =" app-item__icon"
23- :src =" app.icon"
24- alt =" "
25- aria-hidden =" true" >
19+ <AppIcon :icon =" app .icon " :outlined =" outlined " >
2620 <span
2721 v-if =" app.unread"
2822 class =" app-item__unread"
2923 aria-hidden =" true" />
30- </span >
24+ </AppIcon >
3125 <span class =" app-item__label" >
3226 {{ app.name }}
3327 <span v-if =" app.unread" class =" hidden-visually" >, {{ unreadLabel }}</span >
@@ -40,6 +34,7 @@ import type { INavigationEntry } from '../types/navigation.d.ts'
4034
4135import { n } from ' @nextcloud/l10n'
4236import { computed } from ' vue'
37+ import AppIcon from ' ./AppIcon.vue'
4338
4439const props = withDefaults (defineProps <{
4540 app: INavigationEntry
@@ -73,8 +68,6 @@ const unreadLabel = computed(() => {
7368
7469<style scoped lang="scss">
7570.app-item {
76- --app-item-circle-size : calc (var (--default-grid-baseline ) * 10 );
77- --app-item-icon-size : 22px ;
7871 display : flex ;
7972 flex-direction : column ;
8073 align-items : center ;
@@ -100,37 +93,6 @@ const unreadLabel = computed(() => {
10093 box-shadow : inset 0 0 0 2px var (--color-primary-element );
10194 }
10295
103- & __circle {
104- box-sizing : border-box ;
105- position : relative ;
106- width : var (--app-item-circle-size );
107- height : var (--app-item-circle-size );
108- border-radius : 50% ;
109- background-color : var (--color-primary-element );
110- background-image : linear-gradient (
111- to bottom ,
112- rgba (255 , 255 , 255 , 0.18 ) 0% ,
113- rgba (255 , 255 , 255 , 0 ) 45% ,
114- rgba (0 , 0 , 0 , 0.15 ) 100%
115- );
116- box-shadow :
117- inset 0 1px 0 0 rgba (255 , 255 , 255 , 0.25 ),
118- inset 0 -1px 0 0 rgba (0 , 0 , 0 , 0.2 ),
119- 0 2px 4px rgba (0 , 0 , 0 , 0.15 );
120- display : flex ;
121- align-items : center ;
122- justify-content : center ;
123- }
124-
125- & __icon {
126- width : var (--app-item-icon-size );
127- height : var (--app-item-icon-size );
128- // App icons are bright by default; flip them to dark when the
129- // primary color (circle background) is bright (e.g. white in dark mode).
130- filter : var (--primary-invert-if-bright );
131- mask : var (--header-menu-icon-mask );
132- }
133-
13496 & __unread {
13597 position : absolute ;
13698 top : 0 ;
@@ -160,17 +122,5 @@ const unreadLabel = computed(() => {
160122 & --active & __label {
161123 font-weight : bold ;
162124 }
163-
164- // Outlined variant: no fill or gradient.
165- & --outlined & __circle {
166- background : transparent ;
167- background-image : none ;
168- box-shadow : inset 0 0 0 2px var (--color-border-maxcontrast );
169- }
170-
171- & --outlined & __icon {
172- filter : var (--background-invert-if-dark );
173- mask : none ;
174- }
175125}
176126 </style >
0 commit comments