$device-s-width: 640px; $device-m-width: 1200px; :root { --accent: #7b3a99; } // Normalize *, *::before, *::after { box-sizing: border-box; } html, body { width: 100%; height: 100%; min-height: 100%; margin: 0; font-family: 'Lato', sans-serif; font-weight: 300; font-size: 18px; line-height: 1; } textarea { border: none; outline: gray; width: 100%; padding: 1rem; box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010; border-radius: 0.25rem; background: #ffffff; } label { font-weight: 400; } input[type='text'] { border: none; outline: gray; width: 100%; padding: 0.5rem; box-shadow: -2px 4px 4px 0 #00000010; border-radius: 0.25rem; background: #ffffff; font-family: 'Lato'; font-weight: 400; font-size: 16px; color: #555; } .input-select { display: inline-flex; align-items: center; justify-content: space-between; cursor: pointer; font-family: 'Lato'; font-weight: 600; font-size: 16px; color: #555; border: 1px solid #c8c8c8; padding: 0; margin: 0; box-shadow: -2px 2px 16px 0 #00000010; border-radius: 0.25rem; background: linear-gradient(180deg, #f0f0f0, #e8e8e8 20%, #e0e0e0 90%, #cdcdcd); &:hover { border: 1px solid #c4c4c4; box-shadow: -2px 2px 20px 0 #00000010; background: linear-gradient(180deg, #fff, #ededed 20%, #e8e8e8 90%, #c0c0c0); } select { cursor: pointer; height: 100%; appearance: none; transform: translate(0, -0.0625rem); padding: 0.35rem 0 0.35rem 0.35rem; margin: 0; border: none; outline: none; background: none; font-family: 'Lato'; font-weight: 600; font-size: 16px; color: #555; } .material-symbols-outlined { display: grid; place-content: center; width: 1.75rem; height: 1.75rem; transform: translate(0, 0.0625rem); } } button { cursor: pointer; font-family: 'Lato'; font-weight: 600; font-size: 16px; color: #555; border: 1px solid #c8c8c8; padding: 0.5rem 2rem; box-shadow: -2px 2px 16px 0 #00000010; border-radius: 0.25rem; background: linear-gradient(180deg, #f0f0f0, #e8e8e8 20%, #e0e0e0 90%, #cdcdcd); transition: all 100ms ease-in; &:hover { border: 1px solid #c4c4c4; box-shadow: -2px 2px 20px 0 #00000010; background: linear-gradient(180deg, #fff, #ededed 20%, #e8e8e8 90%, #c0c0c0); } &.compact { padding: 0.35rem; font-size: 15px; } &:disabled { cursor: default; opacity: 0.6; filter: grayscale(1); &:hover { border: 1px solid #c8c8c8; box-shadow: -2px 2px 16px 0 #00000010; background: linear-gradient(180deg, #f0f0f0, #e8e8e8 20%, #e0e0e0 90%, #cdcdcd); } } &.icon { padding: 0.125rem; display: grid; place-content: center; .material-symbols-outlined { font-size: 19px; } } } .link, a, a:visited { cursor: pointer; color: var(--accent); text-decoration: none; &:hover { text-decoration: underline; } } // // Typography // .dotted { text-decoration: underline dotted gray; } .math-inline { font-size: 95%; } p { margin: 0; } p + p { margin-top: 0.5rem; } $base-font-size: 16px; $heading-scale: 1.25; @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 4 { h#{$i} { margin: 0; $factor: pow($heading-scale, 4 - $i); font-size: $base-font-size * $factor; font-weight: 500; &:not(:first-child) { padding-top: 0.5rem * $factor; } line-height: 1; } } // // Components // .text-body { font-family: 'EB Garamond', serif; font-weight: 400; font-size: 18px; line-height: 1.41; b, strong { font-weight: 600; } } // // Structure // body { display: flex; flex-direction: column; align-items: center; background: #f8f8f8; } main { padding: 2rem 2rem 6rem; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2rem; .subtitle { font-size: 22px; } .fill-main { display: flex; gap: 0.5rem; width: 100%; max-width: 80ch; } } main.page-home { .board { width: 100%; // min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(auto, 70ch)); gap: 2rem; justify-content: center; .fill-row { grid-column: 1 / -1; } .board-controls { justify-self: start; } } } main.page-problem { summary { padding: 1rem; text-align: center; user-select: none; } } // // Components // details { width: 100%; max-width: 80ch; } .solution-list { display: flex; flex-direction: column; align-items: center; gap: 1rem; .controls { display: flex; width: 100%; gap: 1rem; } } header { display: grid; place-content: center; width: 100%; position: relative; .logo { font-size: 42px; font-family: 'Lato'; font-weight: 300; a:hover { text-decoration: none; border-bottom: 3px solid var(--accent); } } nav { position: absolute; right: 0; display: flex; gap: 1rem; height: 100%; align-items: center; .nav-item { font-size: 20px; font-weight: 300; a.active { border-bottom: 1px solid var(--accent); } a:hover { text-decoration: none; border-bottom: 2px solid var(--accent); } } } } .problem { padding: 1rem; max-width: 80ch; box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010; border-radius: 0.5rem; background: #ffffff; display: flex; flex-direction: column; gap: 0.5rem; .problem-header { display: grid; grid-template-columns: auto; gap: 0.25rem; .problem-title { font-size: 22px; font-weight: 400; } } .problem-content { @extend .text-body; } .problem-footer { font-size: 16px; } } .solution { padding: 1rem 0.5rem 0.5rem 1rem; width: 100%; max-width: 80ch; box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010; border-radius: 0.5rem; background: #ffffff; display: flex; flex-direction: column; gap: 0.5rem; transition: all 100ms ease-in-out; &.correct { border: 4px solid #00aa00; } &.wrong { border: 4px solid #cc0000; } .solution-header { display: grid; grid-template-columns: auto; gap: 0.25rem; font-size: 18px; line-height: 1.25; } .solution-content { @extend .text-body; pre, code { margin: 0; font-family: 'DM Mono', monospace; font-size: 16px; background: #f0f0f0; } pre { padding: 0.25rem; overflow-x: auto; border-radius: 0.25rem; } padding-right: 0.5rem; } .solution-footer { display: flex; justify-content: end; font-size: 16px; .label { font-weight: 400; } .row { display: flex; gap: 0.5rem; align-items: center; } .pending { color: #1653a3; font-style: italic; } .correct { color: green; // font-weight: 400; } .wrong { color: darkred; // font-weight: 400; } .status-label { text-align: right; } } } .form { min-width: 50ch; background: #e0e0e0; display: grid; grid-template-columns: auto 1fr; border: 1px solid #c0c0c0; border-radius: 1rem; // box-shadow: -2px 4px 16px 4px #00000018, -2px 4px 4px 1px #00000018; padding: 1.5rem 2rem 1rem; gap: 1rem; align-items: center; .fill { grid-column: span 2; justify-self: center; } } .markdown-editor { display: grid; width: 100%; grid-template-columns: repeat(2, 1fr); gap: 1rem; .editor, .preview { width: 100%; max-width: 70ch; display: flex; flex-direction: column; align-items: center; gap: 1rem; } .editor { justify-self: end; textarea { font-family: 'DM Mono', monospace; font-size: 16px; resize: none; overflow-y: hidden; min-height: 8rem; } } .preview { justify-self: start; .placeholder { color: #666; } .preview-content { @extend .text-body; width: 100%; padding: 1rem; box-shadow: -2px 4px 6px 1px #00000018, 0 0 4px 0px #00000010; border-radius: 0.25rem; background: #ffffff; } } } // // Mobile // // Not on mobile @media screen and (min-width: $device-s-width) and (pointer: fine) { // ... } // On mobile @media screen and (max-width: $device-s-width), (pointer: coarse) { main { padding: 1rem 1rem 6rem; &.page-home { .board { gap: 1rem; } } } header { display: flex; flex-direction: column; align-items: center; gap: 2rem; nav { position: relative; right: unset; display: flex; flex-direction: column; align-items: center; } } .problem { padding: 0.75rem; } .markdown-editor { grid-template-columns: auto; grid-template-rows: auto auto; } .form { width: 100%; padding: 1rem; min-width: unset; display: flex; flex-direction: column; label { align-self: start; } } textarea, .markdown-editor .preview .preview-content { padding: 0.75rem; } .solution { .solution-content { pre { white-space: pre-line; word-break: break-all; } } } } @media screen and (max-width: $device-m-width), (pointer: coarse) { .markdown-editor { grid-template-columns: auto; grid-template-rows: auto auto; .preview, .editor { justify-self: center; } } }