/* * Scrollbar machinery adapted from Fluid Functionalism and Lina. * * Fluid Functionalism (https://github.com/mickadesign/fluid-functionalism) * MIT License * Copyright (c) 2026 Micka Touillaud * * Lina (https://github.com/SameerJS6/lina), released under the same MIT terms * reproduced below * Copyright (c) 2025 Sameer Singh * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ .lattice-scrollbar { position: absolute; z-index: 20; display: flex; touch-action: none; user-select: none; opacity: 0; transition: opacity var(--motion-fast) var(--duration-moderate);} .lattice-scrollbar[data-hovering],.lattice-scrollbar[data-scrolling],.external-scrollbar:hover,.overlay-scrollbar:hover { opacity: 1; transition-duration: var(--duration-moderate); transition-delay: 0ms;} .external-scrollbar { pointer-events: auto;} .external-scrollbar .lattice-scrollbar-thumb,.overlay-scrollbar .lattice-scrollbar-thumb { flex: none;} /* Leave the corner to whichever bar the pointer is not aiming for. */.overlay-scrollbar[data-orientation="vertical"][data-cross-axis] { height: calc(100% - 10px);} .overlay-scrollbar[data-orientation="horizontal"][data-cross-axis] { width: calc(100% - 10px);} .lattice-scrollbar[data-orientation="vertical"]:not([data-overflow-y-start]):not([data-overflow-y-end]),.lattice-scrollbar[data-orientation="horizontal"]:not([data-overflow-x-start]):not([data-overflow-x-end]) { display: none;} [data-slot="scroll-area"]:has(> [data-slot="scroll-area-viewport"][data-has-vertical-overflow="false"]) > .lattice-scrollbar[data-orientation="vertical"],[data-slot="scroll-area"]:has(> [data-slot="scroll-area-viewport"][data-has-horizontal-overflow="false"]) > .lattice-scrollbar[data-orientation="horizontal"] { display: none;} .lattice-scrollbar[data-orientation="vertical"] { top: 0; right: 0; width: 10px; height: 100%;} .lattice-scrollbar[data-orientation="horizontal"] { bottom: 0; left: 0; flex-direction: column; width: 100%; height: 10px;} .lattice-scrollbar-thumb { position: relative; border-radius: 9999px; background: color-mix(in srgb, var(--text-primary) 8%, transparent); transition: background-color var(--motion-moderate), width var(--motion-moderate), height var(--motion-moderate);} .lattice-scrollbar:hover .lattice-scrollbar-thumb { background: color-mix(in srgb, var(--text-primary) 12%, transparent);} .lattice-scrollbar-thumb:active { background: color-mix(in srgb, var(--text-primary) 16%, transparent);} .lattice-scrollbar[data-orientation="vertical"] .lattice-scrollbar-thumb { width: 4px; height: var(--scroll-area-thumb-height); margin: var(--space-2) auto; transform: translateX(-2px);} .lattice-scrollbar[data-orientation="vertical"]:hover .lattice-scrollbar-thumb { width: 6px;} .lattice-scrollbar[data-orientation="horizontal"] .lattice-scrollbar-thumb { width: var(--scroll-area-thumb-width); height: 4px; margin: auto var(--space-2); transform: translateY(-2px);} .lattice-scrollbar[data-orientation="horizontal"]:hover .lattice-scrollbar-thumb { height: 6px;} /* * Base UI keeps the real scroll position on the viewport and mirrors it through * the adjacent Lattice thumb. App.css also styles native scrollbars globally, * so explicitly suppress the viewport's native track to enforce one scrollbar * per surface. */[data-slot="scroll-area"]:has(> .lattice-scrollbar) > [data-slot="scroll-area-viewport"] { -ms-overflow-style: none !important; scrollbar-width: none !important;} [data-slot="scroll-area"]:has(> .lattice-scrollbar) > [data-slot="scroll-area-viewport"]::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important;} /* Each mask is declared once, on the viewport itself, so its offsets resolve against the edge flags that ScrollArea writes onto the same element. The offsets are registered as non-inherited, and the gradients read them directly rather than through a variable of their own. An inherited custom property that changes restyles everything under the element: the first frame of a scroll from the top (and the last one, at either end) restyled the whole list, 150 ms in WebKit for a library of 600 Papers. */@property --scroll-fade-top { syntax: "<length>"; inherits: false; initial-value: 0px; }@property --scroll-fade-bottom { syntax: "<length>"; inherits: false; initial-value: 0px; }@property --scroll-fade-left { syntax: "<length>"; inherits: false; initial-value: 0px; }@property --scroll-fade-right { syntax: "<length>"; inherits: false; initial-value: 0px; } .scroll-fade,.scroll-fade-x,.scroll-fade-both { --scroll-fade-size: 18px;} .scroll-fade[data-can-scroll-up="true"],.scroll-fade-both[data-can-scroll-up="true"] { --scroll-fade-top: var(--scroll-fade-size);} .scroll-fade[data-can-scroll-down="true"],.scroll-fade-both[data-can-scroll-down="true"] { --scroll-fade-bottom: var(--scroll-fade-size);} .scroll-fade-x[data-can-scroll-left="true"],.scroll-fade-both[data-can-scroll-left="true"] { --scroll-fade-left: var(--scroll-fade-size);} .scroll-fade-x[data-can-scroll-right="true"],.scroll-fade-both[data-can-scroll-right="true"] { --scroll-fade-right: var(--scroll-fade-size);} .scroll-fade { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent 100%);} .scroll-fade-x { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--scroll-fade-left), #000 calc(100% - var(--scroll-fade-right)), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 var(--scroll-fade-left), #000 calc(100% - var(--scroll-fade-right)), transparent 100%);} .scroll-fade-both { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent 100%), linear-gradient(to right, transparent 0, #000 var(--scroll-fade-left), #000 calc(100% - var(--scroll-fade-right)), transparent 100%); -webkit-mask-composite: source-in; mask-image: linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent 100%), linear-gradient(to right, transparent 0, #000 var(--scroll-fade-left), #000 calc(100% - var(--scroll-fade-right)), transparent 100%); mask-composite: intersect;} /* * Some containers must remain the native scroll viewport because feature code * observes that exact element (for example, an infinite-loading drawer). Give * those exceptional surfaces the same quiet, hover-revealed scrollbar without * changing their DOM or event target. * * The standard properties are declared only for engines without * `::-webkit-scrollbar`: setting them makes WebKit and Blink ignore every * pseudo-element rule below. */@supports not selector(::-webkit-scrollbar) { .native-hover-scrollbar { scrollbar-width: thin; scrollbar-color: transparent transparent; } .native-hover-scrollbar:hover { scrollbar-color: color-mix(in srgb, var(--text-primary) 12%, transparent) transparent; }} .native-hover-scrollbar::-webkit-scrollbar { width: 10px; height: 10px;} .native-hover-scrollbar::-webkit-scrollbar-track { background: transparent;} .native-hover-scrollbar::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: var(--radius-pill); background: transparent; background-clip: content-box;} .native-hover-scrollbar::-webkit-scrollbar-thumb:vertical { border-right-width: 5px; border-left-width: 1px;} .native-hover-scrollbar::-webkit-scrollbar-thumb:horizontal { border-top-width: 1px; border-bottom-width: 5px;} .native-hover-scrollbar:hover::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-primary) 12%, transparent); background-clip: content-box;} .native-hover-scrollbar:hover::-webkit-scrollbar-thumb:vertical { border-right-width: 4px; border-left-width: 0;} .native-hover-scrollbar:hover::-webkit-scrollbar-thumb:horizontal { border-top-width: 0; border-bottom-width: 4px;} .native-hover-scrollbar::-webkit-scrollbar-thumb:active { background: color-mix(in srgb, var(--text-primary) 18%, transparent); background-clip: padding-box;} /* An EmptyState with `fill` as its content's child: the content stands at least as tall as the viewport and becomes the column the state fills, so the state centres in the room under its siblings and still scrolls where that room is too short. The touch path has no content shell. */[data-slot="scroll-area-content-shell"]:has(> [data-slot="scroll-area-content"] > .ui-empty-state[data-fill]) { min-height: 100%; display: flex; flex-direction: column;}[data-slot="scroll-area-content"]:has(> .ui-empty-state[data-fill]) { flex: 1 0 auto; display: flex; flex-direction: column;}[data-slot="scroll-area-viewport"] > [data-slot="scroll-area-content"]:has(> .ui-empty-state[data-fill]) { min-height: 100%;} /* A viewport that takes focus itself (a long list read by keyboard) fills the scroll area, which clips: its ring is drawn inside it. */[data-slot="scroll-area-viewport"]:focus-visible { outline-offset: calc(-1 * var(--focus-ring-width));}
/*
* Scrollbar machinery adapted from Fluid Functionalism and Lina.
*
* Fluid Functionalism (https://github.com/mickadesign/fluid-functionalism)
* MIT License
* Copyright (c) 2026 Micka Touillaud
*
* Lina (https://github.com/SameerJS6/lina), released under the same MIT terms
* reproduced below
* Copyright (c) 2025 Sameer Singh
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
.lattice-scrollbar {
position: absolute;
z-index: 20;
display: flex;
touch-action: none;
user-select: none;
opacity: 0;
transition: opacity var(--motion-fast) var(--duration-moderate);
}
.lattice-scrollbar[data-hovering],
.lattice-scrollbar[data-scrolling],
.external-scrollbar:hover,
.overlay-scrollbar:hover {
opacity: 1;
transition-duration: var(--duration-moderate);
transition-delay: 0ms;
}
.external-scrollbar {
pointer-events: auto;
}
.external-scrollbar .lattice-scrollbar-thumb,
.overlay-scrollbar .lattice-scrollbar-thumb {
flex: none;
}
/* Leave the corner to whichever bar the pointer is not aiming for. */
.overlay-scrollbar[data-orientation="vertical"][data-cross-axis] {
height: calc(100% - 10px);
}
.overlay-scrollbar[data-orientation="horizontal"][data-cross-axis] {
width: calc(100% - 10px);
}
.lattice-scrollbar[data-orientation="vertical"]:not([data-overflow-y-start]):not([data-overflow-y-end]),
.lattice-scrollbar[data-orientation="horizontal"]:not([data-overflow-x-start]):not([data-overflow-x-end]) {
display: none;
}
[data-slot="scroll-area"]:has(> [data-slot="scroll-area-viewport"][data-has-vertical-overflow="false"]) > .lattice-scrollbar[data-orientation="vertical"],
[data-slot="scroll-area"]:has(> [data-slot="scroll-area-viewport"][data-has-horizontal-overflow="false"]) > .lattice-scrollbar[data-orientation="horizontal"] {
display: none;
}
.lattice-scrollbar[data-orientation="vertical"] {
top: 0;
right: 0;
width: 10px;
height: 100%;
}
.lattice-scrollbar[data-orientation="horizontal"] {
bottom: 0;
left: 0;
flex-direction: column;
width: 100%;
height: 10px;
}
.lattice-scrollbar-thumb {
position: relative;
border-radius: 9999px;
background: color-mix(in srgb, var(--text-primary) 8%, transparent);
transition: background-color var(--motion-moderate), width var(--motion-moderate), height var(--motion-moderate);
}
.lattice-scrollbar:hover .lattice-scrollbar-thumb {
background: color-mix(in srgb, var(--text-primary) 12%, transparent);
}
.lattice-scrollbar-thumb:active {
background: color-mix(in srgb, var(--text-primary) 16%, transparent);
}
.lattice-scrollbar[data-orientation="vertical"] .lattice-scrollbar-thumb {
width: 4px;
height: var(--scroll-area-thumb-height);
margin: var(--space-2) auto;
transform: translateX(-2px);
}
.lattice-scrollbar[data-orientation="vertical"]:hover .lattice-scrollbar-thumb {
width: 6px;
}
.lattice-scrollbar[data-orientation="horizontal"] .lattice-scrollbar-thumb {
width: var(--scroll-area-thumb-width);
height: 4px;
margin: auto var(--space-2);
transform: translateY(-2px);
}
.lattice-scrollbar[data-orientation="horizontal"]:hover .lattice-scrollbar-thumb {
height: 6px;
}
/*
* Base UI keeps the real scroll position on the viewport and mirrors it through
* the adjacent Lattice thumb. App.css also styles native scrollbars globally,
* so explicitly suppress the viewport's native track to enforce one scrollbar
* per surface.
*/
[data-slot="scroll-area"]:has(> .lattice-scrollbar) > [data-slot="scroll-area-viewport"] {
-ms-overflow-style: none !important;
scrollbar-width: none !important;
}
[data-slot="scroll-area"]:has(> .lattice-scrollbar) > [data-slot="scroll-area-viewport"]::-webkit-scrollbar {
display: none !important;
width: 0 !important;
height: 0 !important;
}
/* Each mask is declared once, on the viewport itself, so its offsets resolve
against the edge flags that ScrollArea writes onto the same element.
The offsets are registered as non-inherited, and the gradients read them
directly rather than through a variable of their own. An inherited custom
property that changes restyles everything under the element: the first
frame of a scroll from the top (and the last one, at either end) restyled
the whole list, 150 ms in WebKit for a library of 600 Papers. */
@property --scroll-fade-top { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --scroll-fade-bottom { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --scroll-fade-left { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --scroll-fade-right { syntax: "<length>"; inherits: false; initial-value: 0px; }
.scroll-fade,
.scroll-fade-x,
.scroll-fade-both {
--scroll-fade-size: 18px;
}
.scroll-fade[data-can-scroll-up="true"],
.scroll-fade-both[data-can-scroll-up="true"] {
--scroll-fade-top: var(--scroll-fade-size);
}
.scroll-fade[data-can-scroll-down="true"],
.scroll-fade-both[data-can-scroll-down="true"] {
--scroll-fade-bottom: var(--scroll-fade-size);
}
.scroll-fade-x[data-can-scroll-left="true"],
.scroll-fade-both[data-can-scroll-left="true"] {
--scroll-fade-left: var(--scroll-fade-size);
}
.scroll-fade-x[data-can-scroll-right="true"],
.scroll-fade-both[data-can-scroll-right="true"] {
--scroll-fade-right: var(--scroll-fade-size);
}
.scroll-fade {
-webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent 100%);
mask-image: linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent 100%);
}
.scroll-fade-x {
-webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--scroll-fade-left), #000 calc(100% - var(--scroll-fade-right)), transparent 100%);
mask-image: linear-gradient(to right, transparent 0, #000 var(--scroll-fade-left), #000 calc(100% - var(--scroll-fade-right)), transparent 100%);
}
.scroll-fade-both {
-webkit-mask-image:
linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent 100%),
linear-gradient(to right, transparent 0, #000 var(--scroll-fade-left), #000 calc(100% - var(--scroll-fade-right)), transparent 100%);
-webkit-mask-composite: source-in;
mask-image:
linear-gradient(to bottom, transparent 0, #000 var(--scroll-fade-top), #000 calc(100% - var(--scroll-fade-bottom)), transparent 100%),
linear-gradient(to right, transparent 0, #000 var(--scroll-fade-left), #000 calc(100% - var(--scroll-fade-right)), transparent 100%);
mask-composite: intersect;
}
/*
* Some containers must remain the native scroll viewport because feature code
* observes that exact element (for example, an infinite-loading drawer). Give
* those exceptional surfaces the same quiet, hover-revealed scrollbar without
* changing their DOM or event target.
*
* The standard properties are declared only for engines without
* `::-webkit-scrollbar`: setting them makes WebKit and Blink ignore every
* pseudo-element rule below.
*/
@supports not selector(::-webkit-scrollbar) {
.native-hover-scrollbar {
scrollbar-width: thin;
scrollbar-color: transparent transparent;
}
.native-hover-scrollbar:hover {
scrollbar-color: color-mix(in srgb, var(--text-primary) 12%, transparent) transparent;
}
}
.native-hover-scrollbar::-webkit-scrollbar {
width: 10px;
height: 10px;
}
.native-hover-scrollbar::-webkit-scrollbar-track {
background: transparent;
}
.native-hover-scrollbar::-webkit-scrollbar-thumb {
border: 3px solid transparent;
border-radius: var(--radius-pill);
background: transparent;
background-clip: content-box;
}
.native-hover-scrollbar::-webkit-scrollbar-thumb:vertical {
border-right-width: 5px;
border-left-width: 1px;
}
.native-hover-scrollbar::-webkit-scrollbar-thumb:horizontal {
border-top-width: 1px;
border-bottom-width: 5px;
}
.native-hover-scrollbar:hover::-webkit-scrollbar-thumb {
background: color-mix(in srgb, var(--text-primary) 12%, transparent);
background-clip: content-box;
}
.native-hover-scrollbar:hover::-webkit-scrollbar-thumb:vertical {
border-right-width: 4px;
border-left-width: 0;
}
.native-hover-scrollbar:hover::-webkit-scrollbar-thumb:horizontal {
border-top-width: 0;
border-bottom-width: 4px;
}
.native-hover-scrollbar::-webkit-scrollbar-thumb:active {
background: color-mix(in srgb, var(--text-primary) 18%, transparent);
background-clip: padding-box;
}
/* An EmptyState with `fill` as its content's child: the content stands at
least as tall as the viewport and becomes the column the state fills, so
the state centres in the room under its siblings and still scrolls where
that room is too short. The touch path has no content shell. */
[data-slot="scroll-area-content-shell"]:has(> [data-slot="scroll-area-content"] > .ui-empty-state[data-fill]) {
min-height: 100%;
display: flex;
flex-direction: column;
}
[data-slot="scroll-area-content"]:has(> .ui-empty-state[data-fill]) {
flex: 1 0 auto;
display: flex;
flex-direction: column;
}
[data-slot="scroll-area-viewport"] > [data-slot="scroll-area-content"]:has(> .ui-empty-state[data-fill]) {
min-height: 100%;
}
/* A viewport that takes focus itself (a long list read by keyboard) fills
the scroll area, which clips: its ring is drawn inside it. */
[data-slot="scroll-area-viewport"]:focus-visible {
outline-offset: calc(-1 * var(--focus-ring-width));
}