treehouse/static/css/main.css
2023-08-31 19:25:19 +02:00

363 lines
6 KiB
CSS

/* Color scheme. */
:root {
/* naturally */
--liquidex-brand-blue: #058ef0;
--text-color-light: #55423e;
--link-color-light: #004ec8;
--link-color-visited-light: #6c2380;
--background-color: rgb(255, 253, 246);
--background-color-tooltip: rgb(226, 223, 214);
--text-color: #55423e;
--link-color: #004ec8;
--link-color-visited: #6c2380;
--shaded-background: rgba(0, 0, 0, 5%);
--border-1: rgba(0, 0, 0, 15%);
--border-2: rgba(0, 0, 0, 30%);
--hover: rgba(0, 0, 0, 15%);
}
@media (prefers-color-scheme: dark) {
:root {
--background-color: rgb(30, 40, 53);
--background-color-tooltip: rgb(23, 31, 41);
--text-color: #d7cdbf;
--link-color: #93cce8;
--link-color-visited: #f7afde;
--shaded-background: #f7e5df0c;
--border-1: #f7e5df26;
--border-2: #f7e5df4d;
}
}
/* Article-style layout. Center everything and give it a maximum width */
body {
max-width: 1200px;
margin-left: auto;
margin-right: auto;
display: flex;
flex-direction: column;
}
main {
padding: 0 16px;
}
@media screen and (max-width: 480px) {
main {
padding: 0 8px;
}
}
/* Choose more pretty colors than vanilla HTML */
body {
background-color: var(--background-color);
color: var(--text-color);
scrollbar-color: var(--background-color);
scrollbar-width: auto;
scrollbar-gutter: stable;
}
body::selection {
/* Even though this color doesn't yield the most readable text, browsers */
background-color: var(--liquidex-brand-blue);
}
/* Set up typography */
body,
pre,
code {
font-family: 'RecVar', sans-serif;
font-size: 14px;
line-height: 1.5;
}
: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;
font-size: 3.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;
}
h4 {
--recursive-slnt: 0.0;
--recursive-casl: 0.5;
--recursive-wght: 700;
font-size: 1rem;
}
pre,
code {
--recursive-mono: 1.0;
--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: 0 0;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 4px 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;
margin: 12px 0;
background-color: var(--shaded-background);
border-radius: 8px;
}
/* And don't let code examples fly off and overflow the window */
pre {
overflow-x: scroll;
}
/* 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: var(--link-color);
}
a:visited {
color: var(--link-color-visited);
}
/* Make blockquotes a bit prettier */
blockquote {
margin: 0;
padding: 2px 12px;
border-left: 4px solid var(--border-1px);
}
/* And tables. */
table {
margin: 8px 0;
}
table,
th,
td {
border: 1px solid var(--border-2);
border-collapse: collapse;
padding: 4px 10px;
}
th {
background-color: var(--shaded-background);
--recursive-wght: 700;
--recursive-casl: 0.5;
}
/* Style the noscript box a little more prettily. */
.noscript {
padding: 16px;
background-color: #fde748;
color: var(--text-color-light);
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;
}
.noscript a {
color: var(--link-color-light);
}
.noscript a:visited {
color: var(--link-color-visited-light);
}
/* also, webkit. */
#webkit-makes-me-go-insane {
display: none;
}
/* Give the logo on the top some nicer looks */
nav {
display: flex;
align-items: center;
}
nav .logo {
width: 48px;
height: 48px;
padding: 16px;
display: block;
opacity: 100%;
color: var(--text-color);
}
/* Style emojis to be readable */
img[is="th-emoji"] {
max-width: 1.5em;
max-height: 1.5em;
vertical-align: bottom;
object-fit: contain;
}
/* And also style emoji tooltips. */
.emoji-wrapper {
position: relative;
}
.emoji-tooltip {
display: none;
flex-direction: column;
align-items: center;
position: absolute;
left: 50%;
transform: translateX(-50%);
width: max-content;
z-index: 100;
background-color: var(--background-color-tooltip);
padding: 8px;
margin-top: 8px;
border-radius: 6px;
}
.emoji-wrapper:hover .emoji-tooltip {
display: flex;
}
.emoji-tooltip img {
display: block;
max-width: 64px;
max-height: 64px;
}
.emoji-tooltip p {
--recursive-wght: 550;
color: var(--text-color);
font-size: 0.75em;
margin: 0;
padding-top: 4px;
line-height: 1;
}
/* Funny joke */
@keyframes hello-there {
0% {
opacity: 0%;
}
70% {
opacity: 0%;
}
100% {
opacity: 70%;
}
}
.oops-you-seem-to-have-gotten-stuck {
margin-top: 16px;
display: none;
position: absolute;
opacity: 0%;
}
#index\:treehouse>details:not([open])>summary .oops-you-seem-to-have-gotten-stuck {
display: inline;
animation: 4s hello-there forwards;
}