treehouse/static/css/main.css

224 lines
3.4 KiB
CSS
Raw Normal View History

2023-08-27 15:27:42 +02:00
/* Color scheme. */
:root {
--background-color: rgb(255, 253, 246);
--text-color: #55423e;
--shaded-background: rgba(0, 0, 0, 5%);
--border-1: rgba(0, 0, 0, 15%);
--border-2: rgba(0, 0, 0, 30%);
}
2023-08-18 18:26:41 +02:00
/* Article-style layout. Center everything and give it a maximum width */
body {
max-width: 1200px;
margin-left: auto;
margin-right: auto;
2023-08-27 15:27:42 +02:00
display: flex;
flex-direction: column;
2023-08-18 18:26:41 +02:00
}
2023-08-20 15:54:06 +02:00
main {
padding: 0 16px;
}
@media screen and (max-width: 480px) {
main {
padding: 0 8px;
}
}
2023-08-18 17:04:12 +02:00
/* Choose more pretty colors than vanilla HTML */
body {
2023-08-27 15:27:42 +02:00
background-color: var(--background-color);
color: var(--text-color);
2023-08-18 17:04:12 +02:00
}
2023-08-18 18:26:41 +02:00
/* Set up typography */
2023-08-18 17:04:12 +02:00
body,
pre,
code {
font-family: 'RecVar', sans-serif;
font-size: 14px;
2023-08-18 18:26:41 +02:00
line-height: 1.5;
2023-08-18 17:04:12 +02:00
}
:root {
--recursive-mono: 0.0;
--recursive-casl: 1.0;
--recursive-wght: 400;
--recursive-slnt: -2.0;
--recursive-crsv: 0.5;
}
*,
*:before,
*:after {
font-variation-settings:
"MONO" var(--recursive-mono),
"CASL" var(--recursive-casl),
"wght" var(--recursive-wght),
"slnt" var(--recursive-slnt),
"CRSV" var(--recursive-crsv);
}
h1 {
--recursive-slnt: 0.0;
--recursive-casl: 0.0;
--recursive-wght: 900;
2023-08-18 18:26:41 +02:00
font-size: 2.5rem;
}
h2 {
--recursive-slnt: 0.0;
--recursive-casl: 0.5;
--recursive-wght: 800;
font-size: 2rem;
}
h3 {
--recursive-slnt: 0.0;
--recursive-casl: 0.5;
--recursive-wght: 700;
font-size: 1.5rem;
2023-08-18 17:04:12 +02:00
}
pre,
code {
--recursive-mono: 1.0;
2023-08-18 18:26:41 +02:00
--recursive-casl: 0.0;
--recursive-slnt: 0.0;
}
b,
strong {
--recursive-wght: 700;
}
i,
em {
--recursive-slnt: -16.0;
}
/* Lay out elements a bit more compactly */
p,
pre {
margin: 6px 0;
}
h1,
h2,
h3 {
margin: 12px 0;
}
/* Lay out elements a little less compactly (actually just have some blank space past the end) */
body {
padding-bottom: 10rem;
}
/* Make code examples a little prettier by giving them visual separation from the rest of the page */
pre {
padding: 8px 12px;
2023-08-18 19:25:38 +02:00
margin: 12px 0;
2023-08-27 15:27:42 +02:00
background-color: var(--shaded-background);
2023-08-18 19:25:38 +02:00
border-radius: 8px;
2023-08-18 18:26:41 +02:00
}
2023-08-20 15:54:06 +02:00
/* And don't let code examples fly off and overflow the window */
pre {
overflow-x: scroll;
}
2023-08-18 18:26:41 +02:00
/* Also don't let images get out of hand */
img {
max-width: 100%;
}
/* Fix the default blue and ugly purple links normally have */
a {
color: #004ec8;
}
a:visited {
color: #6c2380;
}
2023-08-18 19:25:38 +02:00
/* Make blockquotes a bit prettier */
2023-08-18 18:26:41 +02:00
2023-08-18 19:25:38 +02:00
blockquote {
margin: 0;
padding: 2px 12px;
2023-08-27 15:27:42 +02:00
border-left: 4px solid var(--border-1px);
2023-08-18 17:04:12 +02:00
}
2023-08-18 19:25:38 +02:00
/* And tables. */
2023-08-18 17:04:12 +02:00
2023-08-18 20:58:07 +02:00
table {
margin: 8px 0;
}
2023-08-18 17:04:12 +02:00
2023-08-18 19:25:38 +02:00
table,
th,
td {
2023-08-27 15:27:42 +02:00
border: 1px solid var(--border-2);
2023-08-18 19:25:38 +02:00
border-collapse: collapse;
padding: 4px 10px;
2023-08-18 17:04:12 +02:00
}
2023-08-18 19:25:38 +02:00
th {
2023-08-27 15:27:42 +02:00
background-color: var(--shaded-background);
2023-08-18 17:04:12 +02:00
2023-08-18 19:25:38 +02:00
--recursive-wght: 700;
--recursive-casl: 0.5;
2023-08-18 17:04:12 +02:00
}
2023-08-22 18:23:18 +02:00
2023-08-27 15:27:42 +02:00
/* Style the noscript box a little more prettily. */
2023-08-22 18:23:18 +02:00
.noscript {
padding: 16px;
background-color: #fde748;
border: 1px solid #6c581c;
border-radius: 8px;
width: fit-content;
margin-left: auto;
margin-right: auto;
}
.noscript p {
margin-top: 0;
margin-bottom: 16px;
}
.noscript p:last-child {
margin-bottom: 0;
}
2023-08-27 15:27:42 +02:00
/* Give the logo on the top some nicer looks */
nav {
display: flex;
}
nav .logo {
width: 48px;
height: 48px;
padding: 16px;
display: block;
opacity: 100%;
color: var(--text-color);
}