UNPKG

@logo-elements/logo-elements-styles

Version:

Logo Elements Design System is a design system library for modern web applications which gives your web apps Logo Applications look and feel, used by Logo Elements

118 lines (97 loc) 3.17 kB
/** * @license * Copyright LOGO YAZILIM SANAYİ VE TİCARET A.Ş. * * Save to the extent permitted by law, you may not use, copy, modify, * distribute or create derivative works of this material or any part * of it without the prior written consent of LOGO YAZILIM SANAYİ VE TİCARET A.Ş. Limited. * Any reproduction of this material must contain this notice. */ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/register-styles.js'; import '../spacing.js'; import '../style.js'; import { overlay } from './overlay.js'; const menuOverlayCore = css` :host([opening]), :host([closing]) { animation: 0.14s leds-overlay-dummy-animation; } [part='overlay'] { will-change: opacity, transform; } :host([opening]) [part='overlay'] { animation: 0.1s leds-menu-overlay-enter ease-out both; } @keyframes leds-menu-overlay-enter { 0% { opacity: 0; transform: translateY(-4px); } } :host([closing]) [part='overlay'] { animation: 0.1s leds-menu-overlay-exit both; } @keyframes leds-menu-overlay-exit { 100% { opacity: 0; } } `; registerStyles('', menuOverlayCore, { moduleId: 'leds-menu-overlay-core' }); const menuOverlayExt = css` /* Small viewport (bottom sheet) styles */ /* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */ @media (max-width: 420px), (max-height: 420px) { :host { top: 0 !important; right: 0 !important; bottom: var(--logo-overlay-viewport-bottom, 0) !important; left: 0 !important; align-items: stretch !important; justify-content: flex-end !important; } [part='overlay'] { max-height: 50vh; width: 100vw; border-radius: 0; box-shadow: var(--leds-box-shadow-xl); } /* The content part scrolls instead of the overlay part, because of the gradient fade-out */ [part='content'] { padding: 30px var(--leds-space-m); max-height: inherit; box-sizing: border-box; -webkit-overflow-scrolling: touch; overflow: auto; -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent); } [part='backdrop'] { display: block; } /* Animations */ :host([opening]) [part='overlay'] { animation: 0.2s leds-mobile-menu-overlay-enter cubic-bezier(0.215, 0.61, 0.355, 1) both; } :host([closing]), :host([closing]) [part='backdrop'] { animation-delay: 0.14s; } :host([closing]) [part='overlay'] { animation: 0.14s 0.14s leds-mobile-menu-overlay-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both; } } @keyframes leds-mobile-menu-overlay-enter { 0% { transform: translateY(150%); } } @keyframes leds-mobile-menu-overlay-exit { 100% { transform: translateY(150%); } } `; const menuOverlay = [overlay, menuOverlayCore, menuOverlayExt]; registerStyles('', menuOverlay, { moduleId: 'leds-menu-overlay' }); export { menuOverlayCore, menuOverlay };