Skip to content

Build your personal knowledge base with Trilium Notes

feat(mobile): slide dialogs up from the bottom

Elian Doran1e2810206e01
diff --git a/apps/client/src/widgets/react/Modal.css b/apps/client/src/widgets/react/Modal.css
index 33918d8735..c844fe93d8 100644
--- a/apps/client/src/widgets/react/Modal.css
+++ b/apps/client/src/widgets/react/Modal.css
@@ -40,3 +40,34 @@
.script-modal-host {
display: contents;
}
+
+@media (max-width: 991px) {
+ /* Bootstrap times the hide on the `.modal` element's first transition duration, so it matches
+ the dialog's. */
+ body.mobile .modal.fade {
+ opacity: 1;
+ transition: background-color 200ms ease-in;
+
+ .modal-dialog {
+ transform: translate(-50%, calc(100% + var(--mobile-sheet-margin, 0px)));
+ transition: transform 200ms cubic-bezier(0.4, 0, 1, 1);
+ }
+
+ &.show {
+ transition-duration: 300ms;
+ transition-timing-function: ease-out;
+
+ .modal-dialog {
+ transform: translateX(-50%);
+ transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
+ }
+ }
+ }
+}
+
+@media (max-width: 991px) and (prefers-reduced-motion: reduce) {
+ body.mobile .modal.fade .modal-dialog,
+ body.mobile .modal.fade.show .modal-dialog {
+ transition: none;
+ }
+}