Skip to content
Open
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
4 changes: 1 addition & 3 deletions src/client/theme-default/components/VPFlyout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,12 @@ function onBlur() {
.button[aria-expanded="false"] + .menu {
opacity: 0;
visibility: hidden;
transform: translateY(0);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was removed because of a Safari bug that causes the menu to get wrongly clipped. It was also reported in #5050 before.

I noticed an easy fix here is to not use transform here (as it's also not doing anything). This could break for users that set translateY(-2px) or something to have a cool floating effect, but I think it's fine? Alternative I also found that setting will-change: transform fixes it, but this technically incurs some small perf overhead for everyone.

}

.VPFlyout:hover .menu,
.button[aria-expanded="true"] + .menu {
opacity: 1;
visibility: visible;
transform: translateY(0);
}

.button {
Expand Down Expand Up @@ -132,6 +130,6 @@ function onBlur() {
right: 0;
opacity: 0;
visibility: hidden;
transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
transition: opacity 0.25s, visibility 0.25s;
}
</style>
1 change: 1 addition & 0 deletions src/client/theme-default/components/VPNavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ const { isHome, hasSidebar } = useLayout()

.content {
flex-grow: 1;
min-width: 0;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This min-width: 0 (on the flex item parent) allows shrinking the content beyond its content, same for the min-width: 0 in VPNavBarMenu. Both is needed to work.

}

@media (min-width: 60rem) {
Expand Down
7 changes: 6 additions & 1 deletion src/client/theme-default/components/VPNavBarMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ const { theme } = useData()
<style scoped>
.VPNavBarMenu {
display: none;
flex-grow: 1;
justify-content: flex-end;
min-width: 0;
margin-left: 1rem;
overflow-x: clip;
}

.list {
Expand All @@ -40,7 +45,7 @@ const { theme } = useData()

@media (min-width: 48rem) {
.VPNavBarMenu {
display: block;
display: flex;
}
}
</style>
1 change: 0 additions & 1 deletion src/client/theme-default/components/VPNavBarSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ function isEditingContent(event: KeyboardEvent): boolean {
@media (min-width: 48rem) {
.VPNavBarSearch {
gap: 0.5rem;
flex-grow: 1;
padding-left: 1.5rem;
}
}
Expand Down