Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): app menu label position and animation #46916

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions core/src/components/AppMenuEntry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ defineProps<{
text-align: center;
bottom: 0;
left: 50%;
top: 50%;
skjnldsv marked this conversation as resolved.
Show resolved Hide resolved
display: block;
min-width: 100%;
transform: translateX(-50%);
transition: all 0.1s ease-in-out;
width: 100%;
text-overflow: ellipsis;
overflow: hidden;
Expand All @@ -84,44 +84,53 @@ defineProps<{
pointer-events: none;
border-bottom-color: var(--color-main-background);
transform: translateX(-50%);
width: 12px;
width: 10px;
height: 5px;
border-radius: 3px;
background-color: var(--color-background-plain-text);
left: 50%;
bottom: 6px;
bottom: 8px;
display: block;
transition: all 0.1s ease-in-out;
opacity: 1;
}
}

&__icon,
&__label {
transition: all 0.1s ease-in-out;
}

// Make the hovered entry bold to see that it is hovered
&:hover &__label,
&:focus-within &__label {
&:hover .app-menu-entry__label,
&:focus-within .app-menu-entry__label {
skjnldsv marked this conversation as resolved.
Show resolved Hide resolved
font-weight: bold;
}
}
</style>

<style lang="scss">
// Showing the label
.app-menu-entry:hover .app-menu-entry,
.app-menu-entry:focus-within .app-menu-entry,
.app-menu__list:hover .app-menu-entry,
.app-menu__list:focus-within .app-menu-entry {
.app-menu-entry:hover,
.app-menu-entry:focus-within,
.app-menu__list:hover,
.app-menu__list:focus-within {
// Move icon up so that the name does not overflow the icon
&__icon {
.app-menu-entry__icon {
margin-block-end: calc(1.5 * 12px); // font size of label * line height
}

// Make the label visible
&__label {
.app-menu-entry__label {
opacity: 1;
}

// Hide indicator when the text is shown
&--active::before {
.app-menu-entry--active::before {
opacity: 0;
}

.app-menu-icon__unread {
opacity: 0;
}
}
Expand Down
3 changes: 2 additions & 1 deletion core/src/components/AppMenuIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
role="img"
:aria-hidden="ariaHidden"
:aria-label="ariaLabel">
<img class="app-menu-icon__icon" :src="app.icon">
<img class="app-menu-icon__icon" :src="app.icon" alt="">
<IconDot v-if="app.unread" class="app-menu-icon__unread" :size="10" />
</span>
</template>
Expand Down Expand Up @@ -58,6 +58,7 @@ $unread-indicator-size: 10px;
position: absolute;
inset-block-end: calc($unread-indicator-size / -2.5);
inset-inline-end: calc($unread-indicator-size / -2.5);
transition: all 0.1s ease-in-out;
}
}
</style>
4 changes: 2 additions & 2 deletions dist/core-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-main.js.map

Large diffs are not rendered by default.

Loading