Files
web/apps/scandic-web/components/BookingWidget/bookingWidget.module.css
Joakim Jäderberg 3c810d67a2 Merged in feature/SW-1736-foating-booking-widget (pull request #1696)
Feature/SW-1736 floating booking widget

* feature: Add floating booking widget on start page SW-1736

* fix: Make sure we don't try to use IntersectionObserver on the server

* fix: make sure that we disconnect the intersectionobserver when dismounting

* fix: pass searchparams to floating bookingwidget


Approved-by: Michael Zetterberg
2025-04-04 06:52:37 +00:00

76 lines
1.4 KiB
CSS

.wrapper {
position: sticky;
z-index: var(--booking-widget-z-index);
}
.formContainer {
display: grid;
grid-template-rows: auto 1fr;
background-color: var(--UI-Input-Controls-Surface-Normal);
border-radius: 0;
gap: var(--Spacing-x3);
height: calc(100dvh - 20px);
width: 100%;
padding: var(--Spacing-x3) var(--Spacing-x2) var(--Spacing-x7);
position: fixed;
bottom: -100%;
transition: bottom 300ms ease;
}
.compact {
.formContainer {
border-radius: var(--Corner-radius-Large);
}
}
@media screen and (max-width: 767px) {
.formContainer {
border-radius: var(--Corner-radius-Large) var(--Corner-radius-Large) 0 0;
}
}
.wrapper[data-open="true"] {
z-index: var(--booking-widget-open-z-index);
}
.wrapper[data-open="true"] .formContainer {
bottom: 0;
}
.close {
background: none;
border: none;
cursor: pointer;
justify-self: flex-end;
padding: 0;
}
.wrapper[data-open="true"] + .backdrop {
background-color: rgba(0, 0, 0, 0.4);
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 100%;
z-index: calc(var(--booking-widget-open-z-index) - 1);
}
@media screen and (min-width: 768px) {
.wrapper {
top: 0;
}
.formContainer {
display: block;
background-color: var(--Base-Surface-Primary-light-Normal);
box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.05);
height: auto;
position: static;
padding: 0;
}
.close {
display: none;
}
}