Skip to content
Open
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
55 changes: 55 additions & 0 deletions src/wp-includes/css/admin-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,42 @@ html:lang(he-il) .rtl #wpadminbar * {
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
}

@media screen and (min-width: 782px) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is really the heart of this update. Utilize flexbox on the admin bar where it allows plugins to add items to it so that it never overflows onto a new line (instead, scaling proportionally and using an ellipses-based text overflow when needed & looking effectively the same as before when not needed.)

/* Prevent wrapping of admin bar that has more items than admin bar area on desktop/tablet layout */
#wpadminbar .quicklinks {
justify-content: space-between;
}
#wpadminbar .quicklinks > ul > li {
float: none !important;
}
#wpadminbar .quicklinks > ul > li,
#wpadminbar .quicklinks .ab-item {
white-space: nowrap;
text-overflow: ellipsis;
min-width: 0 !important;
}
#wpadminbar .quicklinks .ab-item {
overflow: hidden;
}
#wpadminbar .quicklinks .ab-item .ab-label,
#wpadminbar .quicklinks .ab-item .display-name {
float: none;
display: inline;
}
#wpadminbar .quicklinks,
#wpadminbar .quicklinks > ul {
display: -ms-flexbox;
display: flex;
flex-wrap: nowrap;
-ms-flex-wrap: nowrap;
min-width: 0 !important;
}
#wpadminbar #wp-admin-bar-top-secondary {
flex-direction: row-reverse;
-ms-flex-direction: row-reverse;
}
}

@media screen and (max-width: 782px) {
html {
--wp-admin--admin-bar--height: 46px;
Expand Down Expand Up @@ -1058,6 +1094,25 @@ html:lang(he-il) .rtl #wpadminbar * {
top: 10px;
left: 0;
}
/* Prevent wrapping of admin bar that has more items than admin bar area on mobile layout */
#wpcontent {
padding-top: 15px;
}
#wpadminbar {
display: flex;
flex-wrap: nowrap;
padding-bottom: 15px;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

15px beign the browser scrollbar dimension per https://codepen.io/sambible/post/browser-scrollbar-widths (with the overflow-y:hidden; handling the difference between them)

overflow-x: scroll;
overflow-y: hidden;
}
#wpadminbar > *,
#wpadminbar .ab-top-menu {
display: flex;
flex-wrap: nowrap;
}
#wpadminbar .ab-sub-wrapper {
display: none !important;
}
}

/* Smartphone */
Expand Down