Skip to content

Build your personal knowledge base with Trilium Notes

feat(dialogs): fade scrolled content under the title bar

Elian Doran762c1e0d47c8
diff --git a/apps/client/src/widgets/react/Modal.css b/apps/client/src/widgets/react/Modal.css
index cec3186d65..33918d8735 100644
--- a/apps/client/src/widgets/react/Modal.css
+++ b/apps/client/src/widgets/react/Modal.css
@@ -17,6 +17,26 @@
min-height: 0;
}
+@supports (animation-timeline: scroll()) {
+ .modal-dialog-scrollable .modal-body {
+ --modal-body-fade: 12px;
+ /* A mask cannot be faded in, so it is slid down from above the body as it scrolls. */
+ mask-image: linear-gradient(to bottom, transparent, black var(--modal-body-fade));
+ mask-repeat: no-repeat;
+ mask-size: 100% calc(100% + var(--modal-body-fade));
+ mask-position: 0 calc(-1 * var(--modal-body-fade));
+ animation: modal-body-fade linear both;
+ animation-timeline: scroll(self);
+ animation-range: 0 var(--modal-body-fade);
+ }
+}
+
+@keyframes modal-body-fade {
+ to {
+ mask-position: 0 0;
+ }
+}
+
.script-modal-host {
display: contents;
}