2023-04-14 07:48:55 +00:00
|
|
|
:root {
|
2023-05-05 09:44:41 +00:00
|
|
|
/* This value might be overridden in PHP based on the attribute set by the user. */
|
|
|
|
--drawer-width: 480px;
|
2023-04-14 07:48:55 +00:00
|
|
|
--neg-drawer-width: calc(var(--drawer-width) * -1);
|
|
|
|
}
|
|
|
|
|
2021-09-02 09:44:25 +00:00
|
|
|
$drawer-animation-duration: 0.3s;
|
|
|
|
|
|
|
|
@keyframes fadein {
|
|
|
|
from {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
to {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes slidein {
|
|
|
|
from {
|
|
|
|
transform: translateX(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
to {
|
2023-04-25 11:39:21 +00:00
|
|
|
transform: translateX(max(-100%, var(--neg-drawer-width)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes rtlslidein {
|
|
|
|
from {
|
|
|
|
transform: translateX(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
to {
|
|
|
|
transform: translateX(min(100%, var(--drawer-width)));
|
2021-09-02 09:44:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.wc-block-components-drawer__screen-overlay {
|
|
|
|
background-color: rgba(95, 95, 95, 0.35);
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
position: fixed;
|
|
|
|
right: 0;
|
|
|
|
top: 0;
|
|
|
|
transition: opacity $drawer-animation-duration;
|
2021-10-28 15:48:39 +00:00
|
|
|
z-index: 9999;
|
2021-09-02 09:44:25 +00:00
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.wc-block-components-drawer__screen-overlay--with-slide-out {
|
|
|
|
transition: opacity $drawer-animation-duration;
|
|
|
|
}
|
|
|
|
|
|
|
|
// We can't use transition for the slide-in animation because the element
|
|
|
|
// doesn't exist in the DOM when not open. Instead, use an animation that
|
|
|
|
// is triggered when the element is appended to the DOM.
|
|
|
|
.wc-block-components-drawer__screen-overlay--with-slide-in {
|
|
|
|
animation-duration: $drawer-animation-duration;
|
|
|
|
animation-name: fadein;
|
|
|
|
}
|
|
|
|
|
|
|
|
.wc-block-components-drawer__screen-overlay--is-hidden {
|
|
|
|
pointer-events: none;
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.wc-block-components-drawer {
|
|
|
|
@include with-translucent-border(0 0 0 1px);
|
|
|
|
background: #fff;
|
|
|
|
display: block;
|
|
|
|
height: 100%;
|
|
|
|
left: 100%;
|
|
|
|
position: fixed;
|
|
|
|
right: 0;
|
|
|
|
top: 0;
|
2023-04-14 07:48:55 +00:00
|
|
|
transform: translateX(max(-100%, var(--neg-drawer-width)));
|
|
|
|
width: var(--drawer-width);
|
|
|
|
max-width: 100%;
|
2021-09-02 09:44:25 +00:00
|
|
|
}
|
|
|
|
|
2023-04-17 08:02:26 +00:00
|
|
|
.rtl .wc-block-components-drawer {
|
2023-04-25 11:39:21 +00:00
|
|
|
transform: translateX(min(100%, var(--drawer-width)));
|
2023-04-17 08:02:26 +00:00
|
|
|
}
|
|
|
|
|
2024-05-03 03:28:39 +00:00
|
|
|
.wc-block-components-drawer__screen-overlay--with-slide-out
|
|
|
|
.wc-block-components-drawer {
|
2021-09-02 09:44:25 +00:00
|
|
|
transition: transform $drawer-animation-duration;
|
|
|
|
}
|
|
|
|
|
2024-05-03 03:28:39 +00:00
|
|
|
.wc-block-components-drawer__screen-overlay--with-slide-in
|
|
|
|
.wc-block-components-drawer {
|
2021-09-02 09:44:25 +00:00
|
|
|
animation-duration: $drawer-animation-duration;
|
|
|
|
animation-name: slidein;
|
|
|
|
}
|
|
|
|
|
2024-05-03 03:28:39 +00:00
|
|
|
.rtl
|
|
|
|
.wc-block-components-drawer__screen-overlay--with-slide-in
|
|
|
|
.wc-block-components-drawer {
|
2023-04-25 11:39:21 +00:00
|
|
|
animation-name: rtlslidein;
|
|
|
|
}
|
|
|
|
|
2024-05-03 03:28:39 +00:00
|
|
|
.wc-block-components-drawer__screen-overlay--is-hidden
|
|
|
|
.wc-block-components-drawer {
|
2021-09-02 09:44:25 +00:00
|
|
|
transform: translateX(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@media screen and (prefers-reduced-motion: reduce) {
|
|
|
|
.wc-block-components-drawer__screen-overlay {
|
|
|
|
animation-name: none !important;
|
|
|
|
transition: none !important;
|
|
|
|
}
|
|
|
|
.wc-block-components-drawer {
|
|
|
|
animation-name: none !important;
|
|
|
|
transition: none !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-16 08:41:26 +00:00
|
|
|
// Important rules are needed to reset button styles.
|
2024-05-03 03:28:39 +00:00
|
|
|
.wc-block-components-button.wc-block-components-drawer__close {
|
2023-05-16 08:41:26 +00:00
|
|
|
@include reset-box();
|
|
|
|
background: transparent !important;
|
|
|
|
color: inherit !important;
|
|
|
|
position: absolute !important;
|
|
|
|
top: $gap-small;
|
|
|
|
right: $gap-small;
|
|
|
|
opacity: 0.6;
|
|
|
|
z-index: 2;
|
|
|
|
// Increase clickable area.
|
|
|
|
padding: 1em !important;
|
|
|
|
margin: -1em;
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus,
|
|
|
|
&:active {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Don't show focus styles if the close button hasn't been focused by the
|
|
|
|
// user directly. This is done to prevent focus styles to appear when
|
|
|
|
// opening the drawer with the mouse, as the focus is moved inside
|
|
|
|
// programmatically.
|
|
|
|
&:focus:not(:focus-visible) {
|
|
|
|
box-shadow: none;
|
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
svg {
|
|
|
|
fill: currentColor;
|
|
|
|
display: block;
|
|
|
|
}
|
2021-09-02 09:44:25 +00:00
|
|
|
}
|
|
|
|
|
2023-05-16 08:41:26 +00:00
|
|
|
.wc-block-components-drawer__content {
|
|
|
|
height: 100dvh;
|
2021-09-02 09:44:25 +00:00
|
|
|
position: relative;
|
2023-05-16 08:41:26 +00:00
|
|
|
}
|
2021-09-02 09:44:25 +00:00
|
|
|
|
2023-05-16 08:41:26 +00:00
|
|
|
.admin-bar .wc-block-components-drawer__content {
|
|
|
|
margin-top: 46px;
|
|
|
|
height: calc(100dvh - 46px);
|
2021-09-02 09:44:25 +00:00
|
|
|
}
|
|
|
|
|
2023-05-16 08:41:26 +00:00
|
|
|
@media only screen and (min-width: 783px) {
|
|
|
|
.admin-bar .wc-block-components-drawer__content {
|
|
|
|
margin-top: 32px;
|
|
|
|
height: calc(100dvh - 32px);
|
|
|
|
}
|
2021-09-02 09:44:25 +00:00
|
|
|
}
|