$device-s-width: 640px; $device-m-width: 1200px; // 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: 20px; line-height: 1; } textarea { border: none; outline: gray; width: 100%; padding: 1rem; box-shadow: -2px 4px 8px 1px #00000020, -1px 1px 1px 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 #00000020; border-radius: 0.25rem; background: #ffffff; font-family: 'Lato'; font-weight: 400; font-size: 18px; color: #555; } button { cursor: pointer; font-family: 'Lato'; font-weight: 600; font-size: 18px; color: #555; border: 1px solid #c8c8c8; padding: 0.5rem 2rem; box-shadow: -2px 4px 16px 0 #00000010, -2px 4px 4px 0 #00000010; border-radius: 0.25rem; background: linear-gradient(180deg, #f0f0f0, #dfdfdf 20%, #d8d8d8 80%, #c0c0c0); transition: all 100ms ease-in; &:hover { border: 1px solid #c4c4c4; box-shadow: -2px 4px 20px 4px #00000010, -2px 4px 6px 2px #00000010; background: linear-gradient(180deg, #f8f8f8, #e4e4e4 20%, #e4e4e4 80%, #c8c8c8); } } .link, a, a:visited { cursor: pointer; color: #3a9999; text-decoration: none; &:hover { text-decoration: underline; } } // Typography 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: 21px; 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; .logo { // font-size: 42px; // font-family: 'EB Garamond'; // font-weight: 600; font-size: 38px; font-family: 'Lato'; font-weight: 300; } .subtitle { font-size: 24px; } } main.home { .board { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(60ch, 1fr)); gap: 2rem; } } // // Components // main { .problem { padding: 1rem; // border: 1px solid #ddd; box-shadow: -2px 4px 8px 1px #00000020, -1px 1px 1px 0px #00000010; border-radius: 0.5rem; background: #ffffff; display: grid; grid-template-rows: auto 1fr; gap: 0.5rem; max-width: 80ch; .problem-header { display: grid; grid-template-columns: auto; .problem-title { font-size: 24px; font-weight: 700; } } .problem-content { @extend .text-body; } } .solution-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: 18px; resize: none; overflow-y: hidden; min-height: 8rem; } } .preview { justify-self: start; .placeholder { color: #444; } .preview-content { @extend .text-body; width: 100%; padding: 1rem; box-shadow: -2px 4px 8px 1px #00000020, -1px 1px 1px 0px #00000010; border-radius: 0.25rem; background: #ffffff; } } } .form { min-width: 50ch; display: grid; grid-template-columns: auto 1fr; // border: 2px solid #ccc; 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; } } } .math-inline { font-size: 95%; } // // 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 { .solution-editor { grid-template-columns: auto; grid-template-rows: auto auto; } } } @media screen and (max-width: $device-m-width), (pointer: coarse) { main { .solution-editor { grid-template-columns: auto; grid-template-rows: auto auto; .preview, .editor { justify-self: center; } } } }