UNPKG

@lyra/components

Version:
225 lines (193 loc) 3.64 kB
@import 'part:@lyra/base/theme/variables-style'; .root { display: flex; flex-direction: column; background-color: var(--body-bg); @media (--screen-medium) { /* Reset mobile first */ position: relative; background-color: initial; height: 100%; top: initial; left: initial; width: initial; min-height: initial; } } .isDisabled { display: none; /* hide on mobile */ @media (--screen-medium) { display: flex; } } .isActive { display: flex; } .isCollapsed { @media (--screen-medium) { composes: root; margin-right: 0; border-color: #ccc; padding: 0; width: 3rem; height: 100%; flex-direction: row; } } .header { position: relative; display: flex; justify-content: space-between; box-sizing: border-box; line-height: 3rem; width: 100%; height: 3rem; transition: width 0.8s linear, border 0.8s linear; user-select: none; background-color: inherit; z-index: 2; @nest .isCollapsed & { flex-direction: row; flex-grow: 1; border-color: transparent; } } .headerBackground { position: absolute; height: 100%; width: 100%; top: 0; left: 0; background-color: var(--body-bg); z-index: 0; } .headerContent { z-index: 1; display: flex; flex-wrap: nowrap; flex-grow: 1; justify-content: space-between; align-self: flex-start; transition: all 0.2s linear; transform-origin: 1.2rem 2rem; transform: rotate(0); box-sizing: border-box; height: 3rem; overflow: hidden; padding-left: var(--medium-padding); @nest .isCollapsed & { min-width: 100vh; justify-content: flex-start; transform: rotate(90deg); } } .menuButtonContainer { font-size: 1rem; } .menuWrapper { position: relative; z-index: 2; align-self: flex-end; flex: 0 1 3rem; display: block; @nest .isCollapsed & { display: none; } } .menuButton { display: block; width: 3rem; height: 3rem; text-align: center; } .title { box-sizing: border-box; position: relative; z-index: -1; display: block; margin: 0; padding: 0; font-size: 1rem; font-weight: 600; user-select: none; cursor: default; white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; } .menuContainer { position: absolute; right: 0; @nest & > div { position: absolute; right: 0; } } .functions { display: flex; align-items: flex-end; flex-wrap: nowrap; opacity: 1; transition: opacity 0.8s linear; z-index: 1; flex-direction: row; margin-left: 1em; } .functionsLarge { composes: functions; } .functionsSmall { composes: functions; } .main { flex-grow: 1; display: block; opacity: 1; transition: width 0.8s linear; position: relative; @nest .isCollapsed & { display: none; } } .scrollContainer { display: block; box-sizing: border-box; @media (--screen-medium) { composes: scrollY from 'part:@lyra/base/theme/layout/scrolling-style'; position: absolute; top: -3rem; padding-top: 3rem; left: 0; right: 0; height: calc(100% + 3rem); } @media (--max-screen-medium) { /* Override default scrollcontainer */ transform: initial; position: initial; top: initial; left: initial; height: initial; width: initial; overflow: initial; } @nest .isCollapsed & { display: none; } } .functionsButton { @nest .isCollapsed & { transform: rotate(-90deg); } } .functionsButtonText { white-space: nowrap; text-overflow: ellipsis; @nest .functionsSmall & { display: none; } @nest .isCollapsed & { display: none; } }