zotero/scss/components/_toolbar.scss
Dan Stillman 9415543cbf Move the library view into a <library-view> element (#6035)
Move the #zotero-pane subtree, with the collection and item trees, tag
selector, item pane, quick and Advanced Search, and their keyboard
navigation, into a <library-view> element so that a window can hold
more than one. ZoteroPane forwards its existing view properties and
methods to the window's active library view. Banners stay at the
window level, outside of the library view. No behavior change.

Elements in the subtree get a class matching their id, and CSS rules
select either (e.g., :is(#zotero-items-toolbar, .zotero-items-toolbar))
so that they also apply to additional views. Keeping the id in each
selector preserves the rule's specificity, even when matching only on
class.
2026-11-06 20:58:05 -05:00

151 lines
3.5 KiB
SCSS

$toolbar-padding-inline: 8px;
.toolbar {
height: $height-toolbar !important; /* Hard-code this to fix toolbar icon compression on Linux */
min-height: $height-toolbar; /* Needed to prevent squashing by stretched tag selector */
margin: 0;
padding: 0 $toolbar-padding-inline;
min-width: 1px;
}
:root:-moz-locale-dir(rtl) {
.zotero-tb-button > .toolbarbutton-icon {
transform: scaleX(-1);
}
}
.zotero-toolbar {
-moz-appearance: none;
@media (-moz-platform: macos) {
-moz-window-dragging: drag;
}
@media not (-moz-platform: macos) {
-moz-window-dragging: no-drag;
}
@include inactive-opacity;
}
:is(#zotero-layout-switcher, .zotero-layout-switcher) .zotero-toolbar {
background: var(--material-toolbar);
border-bottom: var(--material-panedivider);
}
:is(#zotero-collections-toolbar, .zotero-collections-toolbar),
:is(#zotero-items-toolbar, .zotero-items-toolbar),
#zotero-item-pane-header,
#zotero-tabs-toolbar {
toolbarbutton {
width: 28px;
height: 28px;
padding: 0px 4px 0px 4px;
&[type="menu"] {
min-width: 0;
width: 40px;
}
}
}
:is(#zotero-items-toolbar, .zotero-items-toolbar),
#zotero-tabs-toolbar {
toolbarbutton {
margin: 0px 4px 0px 4px;
}
}
:is(#zotero-items-toolbar, .zotero-items-toolbar):first-child {
margin-inline-start: -4px;
}
:is(#zotero-collections-toolbar, .zotero-collections-toolbar) {
border-bottom: 1px solid transparent;
}
:is(#zotero-collections-search, .zotero-collections-search) {
max-width: 0;
transition: max-width 0.2s ease;
padding: 0;
padding-inline-end: 6px;
margin: 0;
appearance: none;
height: 28px;
}
:is(#zotero-collections-search, .zotero-collections-search).visible {
max-width: 180px;
}
:is(#zotero-collections-search, .zotero-collections-search).expanding {
padding-inline-end: 35px;
}
/* Hide collection search on pane collapse, otherwise it still shows when focused */
:is(#zotero-collections-pane, .zotero-collections-pane)[collapsed] :is(#zotero-collections-search, .zotero-collections-search).visible {
display: none;
}
/* Hide the add button on pane collapse. Otherwise, it may show on top of 'New Item' */
:is(#zotero-collections-pane, .zotero-collections-pane)[collapsed] :is(#zotero-tb-collection-add, .zotero-tb-collection-add) {
visibility: hidden;
}
:is(#zotero-collections-toolbar, .zotero-collections-toolbar) {
flex-grow: 1;
flex-shrink: 1;
min-width: 0;
}
.zotero-tb-button {
-moz-user-focus: normal;
}
/* Label in toolbar for dev mode or troubleshooting mode */
.toolbar-mode-warning {
font-weight: 600;
cursor: pointer;
margin: 0 .8em 0 .2em;
color: red;
&.safe-mode {
color: darkblue;
@media (prefers-color-scheme: dark) {
color: lightblue;
}
}
}
#zotero-tb-pq-recognize {
@include svgicon-menu('pdf-search-spinner', 'universal', '20');
}
#zotero-tb-pq-recognize .toolbarbutton-icon {
width: 18px;
margin-top: 1px;
}
:is(#zotero-tb-toggle-item-pane-stacked, .zotero-tb-toggle-item-pane-stacked) {
// Hidden except in Stacked mode
display: none;
}
#main-window.stacked :is(#zotero-toolbar-item-tree, .zotero-toolbar-item-tree) {
padding-inline-end: 0;
:is(#zotero-tb-toggle-item-pane-stacked, .zotero-tb-toggle-item-pane-stacked) { // Keep nested for specificity
display: flex;
margin-inline-start: 9px;
}
}
toolbox {
@media (-moz-platform: linux) {
background: Menu;
appearance: initial;
}
}
:is(#zotero-toolbar-collection-tree, .zotero-toolbar-collection-tree) {
// fx140: override default toolbar color on linux
background: var(--material-sidepane);
}