sidebar-main.css (5288B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ 4 5 /* stylelint-disable-next-line media-query-no-invalid */ 6 @media -moz-pref("sidebar.verticalTabs") { 7 :host { 8 --button-size-icon: var(--tab-min-height); 9 --button-min-height: var(--button-size-icon); 10 } 11 } 12 13 [hidden] { 14 display: none !important; 15 } 16 17 :host { 18 width: 100%; 19 } 20 21 .wrapper { 22 display: grid; 23 grid-template-rows: auto min-content min-content; 24 box-sizing: border-box; 25 height: 100%; 26 max-width: 100%; 27 padding-inline: 0; 28 29 /* stylelint-disable-next-line media-query-no-invalid */ 30 @media -moz-pref("sidebar.verticalTabs") { 31 display: flex; 32 flex-direction: column; 33 34 :host([expanded]) & { 35 /* TODO: Should this be some other pixel value between 5/6? Need to be careful of Linux where font size is larger */ 36 --tab-pinned-horizontal-count: 5; 37 /* TODO: These --space-* tokens should use semantic names shared with tabs.css */ 38 width: calc(var(--tab-pinned-horizontal-count) * var(--tab-pinned-min-width-expanded) + 2 * var(--tab-pinned-container-margin-inline-expanded) + 1px); 39 } 40 41 :host([customWidth]) & { 42 width: 100%; 43 } 44 } 45 } 46 47 #sidebar-tools-and-extensions-splitter { 48 display: block; 49 border-top: var(--tabstrip-inner-border); 50 margin-inline: var(--tab-inner-inline-margin); 51 margin-block-end: var(--space-small); 52 min-height: 2px; 53 54 &:hover { 55 background-color: var(--focus-outline-color); 56 border-radius: var(--border-radius-medium); 57 } 58 59 /* stylelint-disable-next-line media-query-no-invalid */ 60 @media not -moz-pref("sidebar.visibility", "expand-on-hover") { 61 /* We need these rules to apply at all times when the sidebar.visibility 62 pref is not set to "expand-on-hover" as opposed to when the "sidebar-expand-on-hover" attribute 63 has not been added to root. There are certain scenarios when that attribute is temporarily 64 removed from root such as when toggling the sidebar to expand with the toolbar button. */ 65 :host([expanded]) & { 66 border-color: transparent; 67 } 68 } 69 } 70 71 .actions-list { 72 display: flex; 73 flex-direction: column; 74 align-items: start; 75 max-width: 100%; 76 overflow: hidden; 77 78 > moz-button { 79 --button-icon-fill: var(--toolbarbutton-icon-fill); 80 --button-attention-dot-color: light-dark(#53b93a, #73d25d); 81 } 82 83 > moz-button:not(.tools-overflow) { 84 --button-outer-padding-inline: var(--space-medium); 85 --button-outer-padding-block: var(--space-xxsmall); 86 87 &:first-of-type { 88 --button-outer-padding-block-start: var(--space-small); 89 } 90 91 &:last-of-type { 92 --button-outer-padding-block-end: var(--space-small); 93 } 94 } 95 96 moz-button:not([type~="ghost"]):not(:hover) { 97 &::part(button) { 98 background-color: var(--toolbarbutton-active-background); 99 } 100 } 101 102 &.overflow-button { 103 flex-shrink: 0; 104 } 105 } 106 107 :host([sidebar-positionend]) .more-tools-button::part(button) { 108 transform: scaleX(-1); 109 } 110 111 .tools-and-extensions[orientation="horizontal"] { 112 :host([expanded]) & { 113 display: flex; 114 flex-wrap: wrap-reverse; 115 flex-direction: row; 116 justify-content: flex-start; 117 align-content: flex-start; 118 gap: var(--space-xxsmall); 119 padding-inline: var(--space-medium); 120 padding-block-end: var(--space-small); 121 122 /* stylelint-disable-next-line media-query-no-invalid */ 123 @media -moz-pref("sidebar.visibility", "expand-on-hover") { 124 /* We need these rules to apply at all times when the sidebar.visibility 125 pref is set to "expand-on-hover" as opposed to when the "sidebar-expand-on-hover" attribute 126 has not been added to root. There are certain scenarios when that attribute is temporarily 127 removed from root such as when toggling the sidebar to expand with the toolbar button. */ 128 margin-block-start: var(--space-small); 129 } 130 131 .tools-overflow { 132 width: unset; 133 } 134 135 &[overflowing="true"] { 136 padding-inline-end: 0; 137 flex-wrap: nowrap; 138 } 139 } 140 } 141 142 .buttons-wrapper { 143 display: flex; 144 flex-direction: column; 145 flex-shrink: 0; 146 justify-content: space-between; 147 min-height: calc(var(--button-min-height) + (var(--space-small) * 2)); 148 overflow: hidden; 149 150 :host([expanded]) & { 151 flex-direction: row; 152 align-items: flex-end; 153 } 154 155 /* stylelint-disable-next-line media-query-no-invalid */ 156 @media -moz-pref("sidebar.visibility", "expand-on-hover") { 157 /* We need these rules to apply at all times when the sidebar.visibility 158 pref is set to "expand-on-hover" as opposed to when the "sidebar-expand-on-hover" attribute 159 has not been added to root. There are certain scenarios when that attribute is temporarily 160 removed from root such as when toggling the sidebar to expand with the toolbar button. */ 161 :host(:not([expanded])) & { 162 grid-template-rows: 1fr; 163 padding-block-end: var(--space-small); 164 } 165 } 166 } 167 168 .bottom-actions > moz-button:last-of-type { 169 --button-outer-padding-block-end: var(--space-medium); 170 } 171 172 @media (prefers-reduced-motion: no-preference) { 173 moz-button::part(moz-button-label) { 174 opacity: 0; 175 transition: opacity 300ms ease-in-out; 176 } 177 } 178 179 .bottom-actions { 180 align-self: end; 181 }