@reown/appkit-scaffold-ui
Version:
The full stack toolkit to build onchain app UX.
222 lines (198 loc) • 6.11 kB
JavaScript
import { css } from '@reown/appkit-ui';
export default css `
:host {
z-index: ${({ tokens }) => tokens.core.zIndex};
display: block;
backface-visibility: hidden;
will-change: opacity;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
opacity: 0;
background-color: ${({ tokens }) => tokens.theme.overlay};
backdrop-filter: blur(0px);
transition:
opacity ${({ durations }) => durations['lg']} ${({ easings }) => easings['ease-out-power-2']},
backdrop-filter ${({ durations }) => durations['lg']}
${({ easings }) => easings['ease-out-power-2']};
will-change: opacity;
}
:host(.open) {
opacity: 1;
backdrop-filter: blur(8px);
}
:host(.appkit-modal) {
position: relative;
pointer-events: unset;
background: none;
width: 100%;
opacity: 1;
}
wui-card {
max-width: var(--apkt-modal-width);
width: 100%;
position: relative;
outline: none;
transform: translateY(4px);
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.05);
transition:
transform ${({ durations }) => durations['lg']}
${({ easings }) => easings['ease-out-power-2']},
border-radius ${({ durations }) => durations['lg']}
${({ easings }) => easings['ease-out-power-1']},
background-color ${({ durations }) => durations['lg']}
${({ easings }) => easings['ease-out-power-1']},
box-shadow ${({ durations }) => durations['lg']}
${({ easings }) => easings['ease-out-power-1']};
will-change: border-radius, background-color, transform, box-shadow;
background-color: ${({ tokens }) => tokens.theme.backgroundPrimary};
padding: var(--local-modal-padding);
box-sizing: border-box;
}
:host(.open) wui-card {
transform: translateY(0px);
}
wui-card::before {
z-index: 1;
pointer-events: none;
content: '';
position: absolute;
inset: 0;
border-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
transition: box-shadow ${({ durations }) => durations['lg']}
${({ easings }) => easings['ease-out-power-2']};
transition-delay: ${({ durations }) => durations['md']};
will-change: box-shadow;
}
:host([data-mobile-fullscreen='true']) wui-card::before {
border-radius: 0px;
}
:host([data-border='true']) wui-card::before {
box-shadow: inset 0px 0px 0px 4px ${({ tokens }) => tokens.theme.foregroundSecondary};
}
:host([data-border='false']) wui-card::before {
box-shadow: inset 0px 0px 0px 1px ${({ tokens }) => tokens.theme.borderPrimaryDark};
}
:host([data-border='true']) wui-card {
animation:
fade-in ${({ durations }) => durations['lg']} ${({ easings }) => easings['ease-out-power-2']},
card-background-border var(--apkt-duration-dynamic)
${({ easings }) => easings['ease-out-power-2']};
animation-fill-mode: backwards, both;
animation-delay: var(--apkt-duration-dynamic);
}
:host([data-border='false']) wui-card {
animation:
fade-in ${({ durations }) => durations['lg']} ${({ easings }) => easings['ease-out-power-2']},
card-background-default var(--apkt-duration-dynamic)
${({ easings }) => easings['ease-out-power-2']};
animation-fill-mode: backwards, both;
animation-delay: 0s;
}
:host(.appkit-modal) wui-card {
max-width: var(--apkt-modal-width);
}
wui-card[shake='true'] {
animation:
fade-in ${({ durations }) => durations['lg']} ${({ easings }) => easings['ease-out-power-2']},
w3m-shake ${({ durations }) => durations['xl']}
${({ easings }) => easings['ease-out-power-2']};
}
wui-flex {
overflow-x: hidden;
overflow-y: auto;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
@media (max-height: 700px) and (min-width: 431px) {
wui-flex {
align-items: flex-start;
}
wui-card {
margin: var(--apkt-spacing-6) 0px;
}
}
@media (max-width: 430px) {
:host([data-mobile-fullscreen='true']) {
height: 100dvh;
}
:host([data-mobile-fullscreen='true']) wui-flex {
align-items: stretch;
}
:host([data-mobile-fullscreen='true']) wui-card {
max-width: 100%;
height: 100%;
border-radius: 0;
border: none;
}
:host(:not([data-mobile-fullscreen='true'])) wui-flex {
align-items: flex-end;
}
:host(:not([data-mobile-fullscreen='true'])) wui-card {
max-width: 100%;
border-bottom: none;
}
:host(:not([data-mobile-fullscreen='true'])) wui-card[data-embedded='true'] {
border-bottom-left-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
border-bottom-right-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
}
:host(:not([data-mobile-fullscreen='true'])) wui-card:not([data-embedded='true']) {
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
wui-card[shake='true'] {
animation: w3m-shake 0.5s ${({ easings }) => easings['ease-out-power-2']};
}
}
@keyframes fade-in {
0% {
transform: scale(0.99) translateY(4px);
}
100% {
transform: scale(1) translateY(0);
}
}
@keyframes w3m-shake {
0% {
transform: scale(1) rotate(0deg);
}
20% {
transform: scale(1) rotate(-1deg);
}
40% {
transform: scale(1) rotate(1.5deg);
}
60% {
transform: scale(1) rotate(-1.5deg);
}
80% {
transform: scale(1) rotate(1deg);
}
100% {
transform: scale(1) rotate(0deg);
}
}
@keyframes card-background-border {
from {
background-color: ${({ tokens }) => tokens.theme.backgroundPrimary};
}
to {
background-color: ${({ tokens }) => tokens.theme.foregroundSecondary};
}
}
@keyframes card-background-default {
from {
background-color: ${({ tokens }) => tokens.theme.foregroundSecondary};
}
to {
background-color: ${({ tokens }) => tokens.theme.backgroundPrimary};
}
}
`;
//# sourceMappingURL=styles.js.map