*, *::before, *::after { box-sizing: border-box; } :root { --bg-light-100: #ffffff; --bg-light-500: #f0f0f0; --bg-light-600: #e0e0e0; --bg-light-700: #d0d0d0; --bg-dark-400: #55555f; --bg-dark-500: #38383d; --fg-light-300: #5d5d5d; --fg-light-400: #3d3d3d; --fg-light-500: #333; --fg-dark-300: #505050; --fg-dark-450: #c0c0c0; --fg-dark-500: #ddd; --ft-mono: 'JetBrains Mono', monospace; --ft-sans: 'Open Sans', sans-serif; --ft-sans-wt-light: 300; --ft-sans-wt-normal: 400; --ft-sans-wt-bold: 600; } body { margin: 0; width: 100%; min-height: 100vh; font-family: var(--ft-sans); font-size: 16px; color: var(--fg-light-500); background: var(--bg-light-500); } // // Structure // main { display: flex; z-index: 0; .sidebar { transition: all 150ms ease-in-out; &.collapsed { width: 0; min-width: 0; } user-select: none; display: flex; flex-direction: column; // padding: 0.5rem 1rem 0 0.5rem; min-height: 100vh; min-width: 13rem; width: 25vw; max-width: 25rem; overflow-x: hidden; color: var(--fg-dark-500); background: var(--bg-dark-500); font-size: 18px; z-index: 1; flex-shrink: 0; .logo { font-size: 24px; font-weight: var(--ft-sans-wt-light); margin: 1rem; } & > .items { margin: 0.5rem; & > .item > .label { min-width: 170px; } } .items { display: flex; flex-direction: column; gap: 0.25rem; & > .item > .label { font-weight: var(--ft-sans-wt-bold); } hr { margin: 0; padding: 0; width: 100%; height: 1px; border: none; background: var(--fg-dark-300); } .item { &.dropdown { cursor: pointer; & .item > .label { font-size: 16px; margin-left: 1.75rem; } } & > .children { padding-top: 0.25rem; display: flex; flex-direction: column; &.collapsed { display: none; } } } .label { padding: 0.5rem; border-radius: 0.25rem; display: flex; min-width: 10rem; .icon { display: flex; align-items: center; justify-content: center; } &:hover { background: var(--bg-dark-400); } } } } .main-content { display: flex; flex-direction: column; align-items: center; flex-grow: 1; height: 100vh; overflow-y: auto; background: var(--bg-light-500); box-shadow: 0 0 2rem 0 #00000022; z-index: 2; header { width: 100%; min-height: 3rem; display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 1rem 0.5rem 0.5rem; gap: 0.75rem; background: var(--bg-light-100); border-bottom: 1px solid var(--bg-light-600); color: var(--fg-light-400); vertical-align: middle; .group { display: flex; align-items: center; gap: 0.5rem; } .label { font-size: 18px; font-weight: var(--ft-sans-wt-light); } .machine { font-size: 24px; font-weight: var(--ft-sans-wt-normal); } } & > .content { display: flex; flex-direction: column; align-items: center; gap: 1rem; flex-grow: 1; padding: 1rem 1rem 0 1rem; } } } // // Utilities // @keyframes toast-fade-in { from { opacity: 0; } to { opacity: 0.95; } } @keyframes toast-fade-out { from { opacity: 0.95; } to { opacity: 0; } } .row { display: flex; align-items: center; justify-content: space-between; flex-grow: 1; gap: 0.5rem; .row-group { display: flex; align-items: center; gap: 0.5rem; } .grow { flex-grow: 1; } } // // Components // .toasts { user-select: none; position: absolute; z-index: 10; left: 50%; transform: translateX(-50%); bottom: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; transition: all 150ms linear; font-size: 15px; .toast { background: #38383d; color: var(--fg-dark-500); padding: 0.5rem 0.5rem 0.5rem 1rem; border-radius: 0.5rem; opacity: 0.95; animation: toast-fade-in 250ms ease-out; transition: opacity 250ms ease-in; display: flex; align-items: center; gap: 0.5rem; .toast-close { display: flex; align-items: center; cursor: pointer; &:hover { color: var(--fg-dark-450); } } &.removed { opacity: 0; } } } .panel { background: var(--bg-light-100); border: 1px solid var(--bg-light-600); padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; & .title { font-weight: var(--ft-sans-wt-bold); code { font-weight: var(--ft-sans-wt-normal); } } } .table { & > .header { display: flex; justify-content: space-between; } & > .cells { display: grid; align-items: center; gap: 0.25rem 0.5rem; .header { display: flex; align-items: center; min-height: 2.25rem; font-weight: var(--ft-sans-wt-bold); } & > div { display: flex; align-items: center; } } } form { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; @extend .panel; label { justify-self: end; font-weight: var(--ft-sans-wt-bold); } .fill { grid-column: span 2; } .title { font-weight: var(--ft-sans-wt-bold); } .center { justify-self: center; } } // // Controls // a, a:hover, a:visited { text-decoration: none; color: inherit; } button, .button { border: none; background: none; font-family: var(--ft-sans); font-size: 16px; color: var(--fg-light-500); text-decoration: none; cursor: pointer; --size: 2.25rem; height: var(--size); padding: 0 0.75rem; border-radius: 2px; display: flex; align-items: center; &.icon { display: flex; justify-content: center; width: var(--size); } &.flat { &:hover { background: #00000018; } } &:not(.flat) { border: 1px solid var(--bg-light-700); background: var(--bg-light-600); &:hover { background: var(--bg-light-700); } } &.delete, &.error { color: #e62929; &:hover { background: #e629291d; } } } input[type='text'], input[type='password'], textarea { border: 1px solid var(--bg-light-700); background: var(--bg-light-100); font-family: var(--ft-sans); font-size: 16px; color: var(--fg-light-500); border-radius: 2px; white-space: pre; overflow-wrap: normal; overflow-x: scroll; &.mono { font-size: 90%; font-family: var(--ft-mono); } &:read-only { color: var(--fg-light-300); background: var(--bg-light-500); } } textarea { padding: 0.5rem; } input[type='text'], input[type='password'] { padding: 0 0.5rem; --size: 2.25rem; height: var(--size); display: flex; align-items: center; } // // Typography // .material-symbols-outlined { font-size: 22px; } b { font-weight: var(--ft-sans-wt-bold); } p { margin: 0; & + p { margin-top: 0.5rem; } } code { font-size: 95%; } $base-font-size: 16px; $heading-scale: 1.33; @function pow($number, $exponent) { $value: 1; @if $exponent > 0 { @for $i from 1 through $exponent { $value: $value * $number; } } @return $value; } @for $i from 1 through 5 { h#{$i} { margin: 0; $factor: pow($heading-scale, 5 - $i); font-size: $base-font-size * $factor; line-height: 1.5; } } // // Routes // .route-index { & > .content { width: 100%; max-width: 1300px; } .widgets { // display: flex; // flex-direction: row; // flex-wrap: wrap; width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); justify-content: center; gap: 1rem; .widget { @extend .panel; min-height: 10rem; &.pie { grid-row: span 2; & > .content { place-content: center; } } & > .content { flex-grow: 1; display: grid; & > canvas { min-width: 250px; min-height: 250px; width: 100%; height: 100%; } } } } } .route-api-keys { .table { min-width: 35rem; .name { button { font-family: var(--ft-mono); } } .actions { display: flex; align-items: center; justify-content: end; gap: 0.5rem; } } } .route-buckets { .table { min-width: 30rem; .cells { grid-template-columns: 1fr auto auto; gap: 0.25rem 1rem; .settings { min-width: 20rem; input[type='text'] { width: 100%; } } .actions { display: flex; align-items: center; justify-content: end; gap: 0.5rem; } } } } .route-bucket { .table { min-width: 30rem; .cells { grid-template-columns: 1fr auto; gap: 0.25rem 1rem; } } } // // Mobile // @media screen and (max-width: 512px) { main { .sidebar { width: 0; min-width: 0; &.collapsed { // width: 100%; min-width: calc(100vw - 3rem); } } .main-content { & > .content { max-width: 100%; } .table { min-width: unset; max-width: 100%; .cells { max-width: 100%; gap: 0; & > div { min-height: 2.25rem; gap: 1rem; padding: 0; } .header { display: none; } display: flex; flex-direction: row; flex-wrap: wrap; } } } } .panel { max-width: 100%; } .route-api-keys .table { .cells { & > div { overflow-x: auto; } .name { &::before { content: 'Nome: '; font-weight: var(--ft-sans-wt-bold); } button { font-size: 90%; word-wrap: break-word; } } .actions { &::before { content: 'Azioni: '; font-weight: var(--ft-sans-wt-bold); } margin-bottom: 1rem; } } } .route-buckets .table .cells { .name { &::before { content: 'Nome: '; font-weight: var(--ft-sans-wt-bold); } } .settings { &::before { content: 'Settings: '; font-weight: var(--ft-sans-wt-bold); } min-width: unset; } .actions { width: 100%; &::before { content: 'Azioni: '; font-weight: var(--ft-sans-wt-bold); } justify-content: start; &:not(:last-child) { margin-bottom: 1rem; } } } input { max-width: 100%; } }