Revision control

Copy as Markdown

Other Tools

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at http://mozilla.org/MPL/2.0/. */
:root {
--listbox-selected-outline: none;
--tree-header-table-height: 30px;
--tree-header-cell-padding: 6px;
--tree-header-cell-indent: 0;
--list-item-min-height: 26px;
--list-item-buttons-size: 22px;
--table-header-cell-icon-width: 24px;
--table-header-cell-icon-min-width: 24px;
--table-row-cell-img-margin-inline-start: 6px;
--table-row-cell-button-margin-inline-start: 4px;
&[uidensity="compact"] {
--tree-header-table-height: 27px;
--tree-header-cell-padding: 3px;
--tree-header-cell-indent: 3px;
--list-item-min-height: 18px;
--list-item-buttons-size: 18px;
--table-header-cell-icon-width: 18px;
--table-header-cell-icon-min-width: 18px;
--table-header-cell-icon-button-padding: 0;
--table-row-cell-img-margin-inline-start: 3px;
--table-row-cell-button-margin-inline-start: 1px;
}
&[uidensity="touch"] {
--tree-header-table-height: 36px;
--tree-header-cell-padding: 9px;
--tree-header-cell-indent: -3px;
--list-item-min-height: 32px;
--table-header-cell-icon-width: 33px;
--table-header-cell-icon-min-width: 33px;
--table-row-cell-img-margin-inline-start: 11px;
--table-row-cell-button-margin-inline-start: 9px;
}
@media not (prefers-contrast) {
--tree-view-bg: var(--color-white);
--tree-view-color: var(--color-ink-90);
--tree-view-header-hover-bg: var(--color-gray-20);
--tree-view-header-hover-active-bg: var(--color-gray-30);
--tree-view-header-border-color: var(--color-gray-30);
--tree-row-delete-button-color: var(--color-red-60);
--listbox-color: var(--color-gray-80);
--listbox-selected-bg: var(--color-gray-20);
--listbox-focused-selected-bg: var(--selected-item-color);
--listbox-selected-color: var(--selected-item-text-color);
--listbox-focused-selected-color: var(--selected-item-text-color);
--listbox-hover: color-mix(in srgb, var(--selected-item-color) 10%, transparent);
--listbox-border-type: dashed;
--unread-color: var(--layout-color-0);
@media (prefers-color-scheme: dark) {
--listbox-color: var(--color-gray-05);
--listbox-selected-bg: var(--color-gray-70);
--listbox-focused-selected-bg: var(--color-blue-60);
--tree-view-bg: var(--color-gray-90);
--tree-view-color: var(--color-gray-30);
--tree-view-header-hover-bg: var(--color-gray-70);
--tree-view-header-hover-active-bg: var(--color-gray-90);
--tree-view-header-border-color: var(--splitter-color);
--tree-row-delete-button-color: var(--color-red-40);
}
}
@media (prefers-contrast) {
--tree-view-bg: Field;
--tree-view-color: FieldText;
--tree-view-header-hover-bg: color-mix(in srgb, Field 70%, hsl(0, 0%, 50%));
--tree-view-header-border-color: ThreeDShadow;
--listbox-color: currentColor;
--listbox-selected-color: SelectedItemText;
--listbox-focused-selected-bg: SelectedItem;
--listbox-hover: color-mix(in srgb, var(--tree-view-bg) 90%, SelectedItem);
--listbox-selected-bg: color-mix(in srgb, var(--tree-view-bg) 80%, var(--listbox-focused-selected-bg));
--listbox-selected-outline: 2px solid SelectedItem;
--listbox-border-type: solid;
--icon-color-prefers-contrast-selected-focused: SelectedItemText;
}
&[lwt-tree] {
--listbox-selected-bg: color-mix(in srgb, var(--tree-view-bg) 70%, var(--sidebar-highlight-background-color));
--listbox-hover: color-mix(in srgb, var(--tree-view-bg) 80%, var(--sidebar-highlight-background-color));
--listbox-focused-selected-bg: var(--sidebar-highlight-background-color, var(--selected-item-color));
--listbox-selected-color: var(--sidebar-highlight-text-color, var(--selected-item-text-color));
}
}
.tree-view-scrollable-container {
display: flex;
align-items: start;
overflow-y: scroll;
overscroll-behavior-y: none;
height: 100%;
}
[is="tree-view-table"] img {
-moz-context-properties: fill, stroke;
fill: color-mix(in srgb, currentColor 20%, transparent);
stroke: currentColor;
}
[is="tree-view-table-body"] {
&:focus {
outline: none;
}
& > * {
cursor: default;
}
& > *:hover {
background-color: var(--listbox-hover);
}
@media (prefers-contrast) {
& > *:hover {
outline: var(--listbox-selected-outline);
outline-offset: -2px;
}
}
& > tr:not([is="thread-card"]).selected {
background-color: var(--listbox-selected-bg);
}
&:is(:focus, :focus-within) > tr:not([is="thread-card"]).selected {
color: var(--listbox-selected-color);
}
&:is(:focus, :focus-within) > .current:not([is="thread-card"], .selected) {
outline: 1px var(--listbox-border-type) var(--listbox-focused-selected-bg);
outline-offset: -1px;
}
&:is(:focus, :focus-within) > td::before {
background-color: var(--selection-indicator-background-unselected-focused);
border-color: var(--selection-indicator-border-unselected-focused);
}
/* Right click state styles */
& tr.context-menu-target:not(.selected) {
&:not([is="thread-card"]) {
background-color: color-mix(in srgb, var(--treeitem-background-active) 10%, transparent);
outline: 1px var(--listbox-border-type) var(--listbox-focused-selected-bg);
outline-offset: -1px;
}
}
[data-properties~="unread"] {
&[is="thread-row"]:not([data-properties~="tagged"]) {
color: var(--unread-color);
}
}
/* Thread row selection styles */
&:is(:focus, :focus-within) > .selected:not([is="thread-card"]),
& > .selected:not([is="thread-card"]):focus-within {
color: var(--listbox-selected-color);
background-color: var(--listbox-focused-selected-bg);
&:not([data-properties~="flagged"],[data-properties~="junk"]) img {
fill: color-mix(in srgb, currentColor 40%, transparent);
stroke: currentColor;
}
& .tree-view-row-thread img {
stroke: var(--listbox-selected-color);
}
}
& [is="thread-row"].selected .twisty {
color: currentColor;
}
}
.multi-selected [is="tree-view-table-body"] {
&,
&:focus {
& > .selected.current {
outline: 1px var(--listbox-border-type) var(--listbox-selected-color);
outline-offset: -1px;
}
}
}
[is="tree-view-table-body"]:is(:focus, :focus-within) > .selected .tree-view-row-thread img {
stroke: var(--listbox-selected-color);
}
tr[is="thread-row"].selected .twisty {
color: currentColor;
}
/* Resizable table columns */
table[is="tree-view-table"] {
table-layout: fixed;
flex: 1 0 100%;
border-spacing: 0;
line-height: 1;
font-size: 1rem;
background-color: var(--tree-view-bg);
color: var(--tree-view-color);
}
thead[is="tree-view-table-header"] {
height: var(--tree-header-table-height);
position: sticky;
inset-inline: 0;
inset-block-start: 0;
z-index: 1;
body:not(.layout-table) & {
display: none;
}
&::after {
content: '';
position: absolute;
inset-inline: 0;
height: 0;
z-index: 1;
border-bottom: 1px solid var(--sidebar-border-color, var(--tree-view-header-border-color));
}
& hr[is="pane-splitter"] {
position: absolute;
inset-inline-end: 4px;
inset-block: 3px;
&:hover:not(:active,[disabled]) {
background-color: var(--selected-item-color);
}
}
}
th[is="tree-view-table-header-cell"] {
height: var(--tree-header-table-height);
min-width: 7ch;
padding: 0;
position: relative;
overflow: hidden;
background-color: var(--tree-view-bg);
&[data-type="icon"] {
width: var(--table-header-cell-icon-width);
min-width: var(--table-header-cell-icon-min-width);
& button {
padding: var(--table-header-cell-icon-button-padding, var(--tree-header-cell-padding));
}
& img {
display: block;
margin-inline: auto;
}
}
& hr[is="pane-splitter"] {
border-inline-start-style: none !important;
border-inline-end-style: solid;
}
}
/* Select column */
#selectColButton {
padding-inline: 0;
}
:is(.tree-view-header-select, .tree-view-row-select) img {
color: var(--tree-view-color);
content: var(--icon-checkbox);
-moz-context-properties: fill, fill-opacity, stroke, stroke-opacity;
fill: currentColor;
fill-opacity: 0;
stroke-opacity: 0;
}
[is="tree-view-table-body"]:is(:focus, :focus-within) >
.selected :is(.tree-view-header-select, .tree-view-row-select) img,
[is="tree-view-table-body"] > .selected:focus-within
:is(.tree-view-header-select, .tree-view-row-select) img {
color: currentColor;
}
.tree-view-row-select img {
display: block;
margin-inline: auto;
}
.some-selected .tree-view-header-select img {
stroke-opacity: 1;
}
:is(.all-selected, .selected) :is(.tree-view-header-select, .tree-view-row-select) img {
fill-opacity: 1;
}
[is="tree-view-table-body"]:is(:focus, :focus-within) .selected > .tree-view-row-select img,
[is="tree-view-table-body"] .selected:focus-within > .tree-view-row-select img {
fill: currentColor;
}
/* Delete column */
.tree-view-row-delete button {
color: var(--tree-view-color);
opacity: 0.8;
&:hover {
opacity: 1;
color: var(--tree-row-delete-button-color);
}
[is="tree-view-table-body"]:is(:focus, :focus-within) .selected &,
[is="tree-view-table-body"] .selected:focus-within & {
color: currentColor;
}
}
.tree-view-header-delete img,
.tree-view-row-delete img {
content: var(--icon-trash-sm);
pointer-events: none;
}
.tree-table-cell {
position: absolute;
inset-block: 0;
inset-inline: 0 1px;
th[data-resizable="false"] & {
inset-inline: 0;
}
}
.tree-table-cell-container button {
font-size: 1rem;
font-weight: normal;
overflow: hidden;
text-overflow: ellipsis;
text-indent: var(--tree-header-cell-indent);
white-space: nowrap;
text-align: start;
padding: var(--tree-header-cell-padding);
margin: 0;
width: 100%;
height: 100%;
min-width: auto;
min-height: auto;
color: inherit;
border: none;
border-radius: 0;
background-color: transparent;
background-position: right 6px center;
background-repeat: no-repeat;
-moz-context-properties: stroke;
stroke: currentColor;
&:dir(rtl) {
background-position-x: left 6px;
}
&:hover {
background-color: var(--tree-view-header-hover-bg);
&:active {
background-color: var(--tree-view-header-hover-active-bg);
}
}
&:focus-visible {
outline: 2px solid var(--selected-item-color);
outline-offset: -2px;
border-radius: var(--button-border-radius);
}
&.tree-view-header-delete {
text-align: center;
}
&.sorting {
background-image: var(--icon-nav-up-sm);
padding-inline-end: 18px;
@media (-moz-platform: linux) {
background-image: var(--icon-nav-down-sm);
}
&.descending {
background-image: var(--icon-nav-down-sm);
@media (-moz-platform: linux) {
background-image: var(--icon-nav-up-sm);
}
}
}
th[data-type="icon"] &.sorting {
background-image: none;
padding-inline-end: var(--tree-header-cell-padding);
}
}
th[is="tree-view-table-column-picker"] {
position: relative;
width: 25px;
min-width: 25px;
padding: 0;
background-color: var(--tree-view-bg);
@media (-moz-overlay-scrollbars) {
padding-inline-end: env(scrollbar-inline-size);
}
}
.button-column-picker {
position: absolute;
inset: 0;
& img {
content: var(--icon-column-menu);
margin-inline: 0;
}
}
/* Table body */
table[is="tree-view-table"] tr.selected td.current-cell {
outline: 1px dashed var(--selected-item-text-color);
}
table[is="tree-view-table"] {
tbody tr[is="thread-row"] td:not([colspan="2"]) button:not(.twisty) {
height: 100%;
width: 100%;
}
td {
max-width: 0;
height: inherit;
overflow-x: clip;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 6px;
position: relative;
user-select: none;
box-sizing: border-box;
&:is(.button-column, .tree-view-row-select) {
padding: 0;
text-align: center;
}
&.button-column[colspan="2"] {
text-align: start;
& img {
margin-inline-start: var(--table-row-cell-img-margin-inline-start);
}
}
#threadTree &.button-column[colspan="2"] button {
margin-inline-start: var(--table-row-cell-button-margin-inline-start);
&.tree-button-delete {
padding-inline: 2px;
}
}
& div:not(.recipient-avatar, .thread-card-icon-info, .thread-card-last-row) {
overflow: hidden;
text-overflow: ellipsis;
}
&.current-cell {
outline: 1px dashed var(--focus-outline-color);
outline-offset: -2px;
}
}
}
/* Placeholder */
slot[name="placeholders"] {
position: absolute;
display: none;
box-sizing: border-box;
inset: 120px 0 auto;
padding: 0 40px;
opacity: 0.5;
text-align: center;
&.show {
display: block;
}
& > div {
font-size: 1.5rem;
line-height: 1.2;
font-weight: 600;
margin-block-end: 12px;
text-shadow: 0 1px 0 var(--sidebar-background-color, var(--tree-view-bg));
}
& div::before {
content: "";
display: block;
height: 32px;
margin-block-end: 9px;
background-position: center top;
background-size: contain;
background-repeat: no-repeat;
-moz-context-properties: fill, stroke, fill-opacity;
fill: color-mix(in srgb, currentColor 20%, transparent);
stroke: currentColor;
fill-opacity: var(--toolbarbutton-icon-fill-opacity);
}
}
/* Transitions and animations */
@media (prefers-reduced-motion: no-preference) {
.tree-view-scrollable-container {
scroll-behavior: smooth;
}
thead[is="tree-view-table-header"] hr[is="pane-splitter"] {
transition: background-color var(--transition-duration) var(--transition-timing);
}
table[is="tree-view-table"] tbody tr {
transition:
color var(--transition-duration) var(--transition-timing),
background-color var(--transition-duration) var(--transition-timing);
& img {
transition:
color var(--transition-duration) var(--transition-timing),
fill var(--transition-duration) var(--transition-timing),
stroke var(--transition-duration) var(--transition-timing);
}
}
}
:is(ul, ol):is([role="tree"],[role="treegrid"],[role="group"]) li > div {
min-height: var(--list-item-min-height);
}
.no-overscroll {
overscroll-behavior-y: none;
}
/* Drag and Drop */
th.column-dragging {
opacity: 0.7;
z-index: 2;
}