You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

402 lines
6.7 KiB
SCSS

$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 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);
}
}
.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%;
// min-width: 0;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(auto, 70ch));
gap: 2rem;
justify-content: center;
}
}
main.problem {
summary {
padding: 1rem;
text-align: center;
user-select: none;
}
.solution-list {
display: flex;
flex-direction: column;
gap: 1rem;
}
}
//
// Components
//
main {
.problem {
padding: 1rem;
max-width: 80ch;
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;
.problem-header {
display: grid;
grid-template-columns: auto;
gap: 0.25rem;
.problem-title {
font-size: 24px;
font-weight: 700;
}
.problem-author {
grid-row: 2;
font-size: 16px;
color: #000000dd;
// font-weight: 400;
}
}
.problem-content {
@extend .text-body;
}
}
.solution {
padding: 1rem;
max-width: 80ch;
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;
.solution-header {
display: grid;
grid-template-columns: auto;
gap: 0.25rem;
}
.solution-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;
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;
}
}
}
.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;
}
}
}
}