Bug 1938301 - Wrap tools and extensions when sidebar is expanded r=sidebar-reviewers,desktop-theme-reviewers,kcochrane
Differential Revision: https://phabricator.services.mozilla.com/D232675
This commit is contained in:
@@ -71,25 +71,16 @@
|
||||
|
||||
.tools-and-extensions[orientation="horizontal"] {
|
||||
:host([expanded]) & {
|
||||
/* button width + extra inline padding to extend to the edge of sidebar + inline padding between adjacent buttons */
|
||||
--first-last-button-width: calc(var(--button-size-icon) + var(--space-medium) + var(--space-xxsmall));
|
||||
display: grid;
|
||||
grid-template-columns: var(--first-last-button-width) repeat(4, calc(var(--button-size-icon) + var(--space-xsmall))) var(--first-last-button-width);
|
||||
}
|
||||
display: flex;
|
||||
flex-wrap: wrap-reverse;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
gap: var(--space-xxsmall);
|
||||
padding-inline: var(--space-medium);
|
||||
padding-block-end: var(--space-small);
|
||||
|
||||
> moz-button.tools-overflow {
|
||||
width: min-content;
|
||||
--button-outer-padding-inline: var(--space-xxsmall);
|
||||
--button-outer-padding-block: var(--space-xxsmall);
|
||||
|
||||
/* First button in every row */
|
||||
&:nth-of-type(6n + 1) {
|
||||
--button-outer-padding-inline-start: var(--space-medium);
|
||||
}
|
||||
|
||||
/* Last button in every row */
|
||||
&:nth-of-type(6n) {
|
||||
--button-outer-padding-inline-end: var(--space-medium);
|
||||
.tools-overflow {
|
||||
width: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,13 +89,6 @@
|
||||
--button-outer-padding-block-end: var(--space-medium);
|
||||
}
|
||||
|
||||
/* stylelint-disable-next-line media-query-no-invalid */
|
||||
@media (-moz-bool-pref: "sidebar.verticalTabs") {
|
||||
.tools-and-extensions > moz-button:last-of-type {
|
||||
--button-outer-padding-block-end: var(--space-medium);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
moz-button::part(moz-button-label) {
|
||||
opacity: 0;
|
||||
|
||||
@@ -383,10 +383,12 @@ export default class SidebarMain extends MozLitElement {
|
||||
class="tools-and-extensions actions-list"
|
||||
orientation=${this.isToolsOverflowing() ? "horizontal" : "vertical"}
|
||||
>
|
||||
${repeat(
|
||||
this.getToolsAndExtensions().values(),
|
||||
action => action.view,
|
||||
action => this.entrypointTemplate(action)
|
||||
${when(!this.isToolsOverflowing(), () =>
|
||||
repeat(
|
||||
this.getToolsAndExtensions().values(),
|
||||
action => action.view,
|
||||
action => this.entrypointTemplate(action)
|
||||
)
|
||||
)}
|
||||
${when(window.SidebarController.sidebarVerticalTabsEnabled, () =>
|
||||
repeat(
|
||||
@@ -395,6 +397,13 @@ export default class SidebarMain extends MozLitElement {
|
||||
action => this.entrypointTemplate(action)
|
||||
)
|
||||
)}
|
||||
${when(this.isToolsOverflowing(), () =>
|
||||
repeat(
|
||||
this.getToolsAndExtensions().values(),
|
||||
action => action.view,
|
||||
action => this.entrypointTemplate(action)
|
||||
)
|
||||
)}
|
||||
</button-group>
|
||||
${when(
|
||||
!window.SidebarController.sidebarVerticalTabsEnabled,
|
||||
|
||||
Reference in New Issue
Block a user