zotero/scss/components/_tabBar.scss

260 lines
4.3 KiB
SCSS
Raw Normal View History

2020-09-15 07:30:17 +00:00
#tab-bar-container {
// These variables can be overridden in platform styles to set platform-specific safe areas
--safe-area-start: 0;
--safe-area-end: 0;
--tab-border: .5px solid var(--tab-border);
background: var(--material-tabbar);
-moz-window-dragging: drag;
2023-12-14 08:43:11 +00:00
min-height: var(--tab-min-height);
flex: 1;
@include macOS-inactive-opacity;
&:not([hidden]) {
// display: flex overrides the hidden attribute
display: flex;
}
&::before {
content: '';
min-width: var(--safe-area-start);
// Add bottom border to safe area space
border-bottom: var(--tab-border);
}
&::after {
content: '';
min-width: var(--safe-area-end);
// Add bottom border to safe area space
border-bottom: var(--tab-border);
}
& > div {
flex-grow: 1;
}
2020-09-15 07:30:17 +00:00
}
2023-12-15 09:51:39 +00:00
#zotero-tabs-toolbar {
background: var(--material-tabbar);
}
.tab-bar-inner-container {
display: flex;
.tabs-wrapper {
position: relative;
flex-grow: 1;
}
.scroll-start-arrow, .scroll-end-arrow {
2023-12-14 08:43:11 +00:00
padding: 0 4px;
align-items: center;
2023-12-14 08:43:11 +00:00
color: var(--fill-secondary);
display: none;
box-shadow: none;
2023-12-14 08:43:11 +00:00
z-index: 1;
> button {
width: auto;
padding: 0;
border: 0;
height: 28px;
border-radius: 5px;
background: transparent;
}
.icon {
display: flex;
2023-12-14 08:43:11 +00:00
fill: var(--fill-tertiary);
}
&.active {
2023-12-14 08:43:11 +00:00
button {
&:hover {
background-color: var(--fill-quinary);
}
&:active {
background-color: var(--fill-quarternary);
}
}
.icon {
fill: var(--fill-secondary);
}
}
}
.scroll-start-arrow {
border-right: var(--material-border-transparent);
2023-12-14 08:43:11 +00:00
border-left: var(--material-border-quarternary);
&.active {
border-right: var(--material-panedivider);
2023-12-14 08:43:11 +00:00
box-shadow: 0.5px 0.5px 0px -0.5px rgba(0, 0, 0, 0.05), 3px 0px 3px -3px rgba(0, 0, 0, .3)
}
}
.scroll-end-arrow {
border-left: var(--material-border-transparent);
2023-12-14 08:43:11 +00:00
&.active {
border-left: var(--material-panedivider);
2023-12-14 08:43:11 +00:00
box-shadow: -0.5px 0.5px 0px -0.5px rgba(0, 0, 0, 0.05), -3px 0 3px -3px rgba(0, 0, 0, .3)
}
.icon {
transform: rotate(180deg);
}
}
2022-05-03 05:21:59 +00:00
.pinned-tabs {
display: none;
2023-12-14 08:43:11 +00:00
padding-right: 8px;
.tabs {
overflow: unset;
2024-03-14 17:09:07 +00:00
position: unset;
2023-12-14 08:43:11 +00:00
}
2022-05-03 05:21:59 +00:00
.tab {
2023-12-14 08:43:11 +00:00
max-width: 100px;
2022-05-03 05:21:59 +00:00
}
}
&.scrollable {
.tabs-wrapper > .tabs > :first-child {
display: none;
}
.scroll-start-arrow, .scroll-end-arrow {
display: flex;
}
.pinned-tabs {
display: block;
}
}
}
2020-09-15 07:30:17 +00:00
.tabs {
display: flex;
position: absolute;
overflow: hidden;
left: 0;
right: 0;
2023-12-14 08:43:11 +00:00
padding: 4px 1px;
column-gap: 4px;
-moz-window-dragging: drag;
2020-09-15 07:30:17 +00:00
2023-12-14 08:43:11 +00:00
.pinned-tabs & {
padding: 4px 0;
2020-10-22 10:12:31 +00:00
}
2020-09-21 09:50:00 +00:00
}
2020-09-15 07:30:17 +00:00
.tab {
2020-12-22 11:05:00 +00:00
box-sizing: border-box;
max-width: 200px;
2020-10-22 10:12:31 +00:00
flex: 1 1 200px;
2020-09-15 07:30:17 +00:00
position: relative;
color: var(--fill-primary);
text-align: center;
2023-12-14 08:43:11 +00:00
min-width: 100px;
height: 28px;
line-height: 16px;
padding-inline-end: 22px;
padding-inline-start: 6px;
2023-12-14 08:43:11 +00:00
display: flex;
align-items: center;
2023-12-14 08:43:11 +00:00
border-radius: 5px;
transition: background-color 0.1s ease-out;
-moz-window-dragging: no-drag;
@include macOS-inactive-opacity;
2023-12-14 08:43:11 +00:00
2020-09-18 06:45:41 +00:00
&.selected {
background: var(--material-button);
box-shadow: 0px 0px 0px 0.5px rgba(0, 0, 0, 0.05), 0px 0.5px 2.5px 0px rgba(0, 0, 0, 0.30);
2020-09-18 06:45:41 +00:00
}
2023-12-14 08:43:11 +00:00
&.dragging {
z-index: 1;
}
2023-12-14 08:43:11 +00:00
&:not(:last-child) {
border-inline-end: var(--tab-border);
}
&:not(.selected):hover {
background-color: var(--fill-quinary);
}
&:first-child {
padding: 6px; // no 22px padding for X button because pinned tab cannot be closed
.tab-close {
display: none;
}
}
2020-09-15 07:30:17 +00:00
.tab-name {
2023-12-14 08:43:11 +00:00
flex: 1 1 100%;
line-height: 1.38461538em;
2023-12-14 08:43:11 +00:00
margin-inline-start: 4px;
overflow: hidden;
text-align: start;
2023-12-14 08:43:11 +00:00
white-space: nowrap;
&.overflowing {
&:dir(ltr) {
mask-image: linear-gradient(to left, transparent 0px, var(--fill-primary) 20px);
}
&:dir(rtl) {
mask-image: linear-gradient(to right, transparent 0px, var(--fill-primary) 20px);
}
}
2020-09-15 07:30:17 +00:00
}
2020-12-22 11:05:00 +00:00
2023-12-14 08:43:11 +00:00
.tab-icon {
flex: 0 0 16px;
height: 16px;
2023-12-14 08:43:11 +00:00
}
2020-09-15 07:30:17 +00:00
.tab-close {
position: absolute;
2023-12-14 08:43:11 +00:00
transition: background-color 0.1s ease-out;
&:dir(ltr) {
right: 6px;
}
&:dir(rtl) {
left: 6px;
}
2020-09-15 07:30:17 +00:00
width: 16px;
height: 16px;
text-align: center;
line-height: 16px;
2020-12-22 11:05:00 +00:00
border-radius: 3px;
.icon {
display: flex;
}
2020-12-22 11:05:00 +00:00
&:hover {
background-color: var(--fill-quinary);
2020-12-22 11:05:00 +00:00
}
&:active {
background-color: var(--fill-quarternary);
2020-12-22 11:05:00 +00:00
}
2020-09-15 07:30:17 +00:00
}
2022-05-03 05:21:59 +00:00
2020-10-22 10:12:31 +00:00
&:not(.selected) {
border-bottom: var(--tab-border);
2020-10-22 10:12:31 +00:00
}
}