treehouse/static/css/main.css

1262 lines
25 KiB
CSS
Raw Normal View History

/* Main layout */
2023-08-27 15:27:42 +02:00
body {
--main-min-size: 100vh;
2023-08-27 19:40:47 +02:00
margin: 0;
2023-08-27 15:27:42 +02:00
display: grid;
grid-template-columns:
[left] minmax(0, 1fr)
[right] auto;
grid-template-rows:
[nav] auto
[main] minmax(var(--main-min-size), auto)
[virtual] 100vh;
}
html {
/* Leave a bunch of space at the top when scrolling to elements.
I'm honestly not sure why this is needed on <html> and not the scrolled-to element... */
scroll-padding-top: 10vh;
2023-08-27 17:01:27 +02:00
}
.sidebar-sticky {
grid-column: right;
grid-row: main;
2024-06-13 21:50:09 +02:00
}
aside.sidebar {
position: sticky;
top: 0px;
2023-08-18 18:26:41 +02:00
max-width: 50rem;
height: 100vh;
padding: 0.8rem;
2023-08-27 15:27:42 +02:00
display: flex;
2023-08-18 18:26:41 +02:00
}
2023-08-20 15:54:06 +02:00
main {
grid-column: left;
grid-row: main;
min-width: 0;
2023-08-20 15:54:06 +02:00
}
footer.pink-space {
grid-column: 1 / -1;
grid-row: virtual;
}
/* Narrower layout: sidebar is pushed to the top */
@media (max-width: 1280px) {
body {
--main-min-size: 0;
}
2023-08-18 17:04:12 +02:00
.sidebar-sticky {
grid-column: left;
grid-row: nav;
display: flex;
justify-content: center;
}
aside.sidebar {
position: relative;
height: auto;
padding: 0;
}
2024-06-13 20:10:38 +02:00
}
/* Choose more pretty colors than vanilla HTML */
2023-08-18 17:04:12 +02:00
body {
2023-08-27 15:27:42 +02:00
background-color: var(--background-color);
color: var(--text-color);
2023-08-27 19:40:47 +02:00
}
:root {
scrollbar-color: var(--border-2) var(--shaded-background);
scrollbar-width: auto;
scrollbar-gutter: stable;
2023-08-18 17:04:12 +02:00
}
2024-12-08 12:45:29 +01:00
:focus-visible {
outline: 0.1rem solid var(--accent-blue);
outline-offset: 0.2rem;
2024-12-08 12:45:29 +01:00
}
2025-08-30 13:13:29 +02:00
::selection {
background-color: color-mix(
in srgb,
var(--background-color),
var(--accent-pink) 75%
);
color: var(--text-color);
}
@media (prefers-color-scheme: dark) {
::selection {
background-color: var(--accent-pink);
color: var(--background-color);
}
}
2023-08-18 18:26:41 +02:00
/* Set up typography */
2023-08-18 17:04:12 +02:00
2024-06-13 22:00:26 +02:00
body,
pre,
code,
kbd,
2024-12-08 12:45:29 +01:00
button,
2024-12-08 12:45:29 +01:00
select,
input,
dfn {
font-family: "RecVar", sans-serif;
2024-12-08 12:45:29 +01:00
font-style: normal;
2023-08-18 18:26:41 +02:00
line-height: 1.5;
text-size-adjust: none;
2023-08-18 17:04:12 +02:00
}
html {
font-size: 62.5%;
}
2024-06-13 22:00:26 +02:00
body {
font-size: 1.6rem;
2024-06-13 22:00:26 +02:00
}
2024-05-18 13:41:43 +02:00
pre,
code,
kbd,
2024-12-08 12:45:29 +01:00
button,
2024-12-08 12:45:29 +01:00
select,
input {
font-size: inherit;
2024-05-18 13:41:43 +02:00
}
2023-08-18 17:04:12 +02:00
:root {
--recursive-mono: 0;
--recursive-casl: 0;
--recursive-wght: 450;
--recursive-slnt: 0;
2023-08-18 17:04:12 +02:00
--recursive-crsv: 0.5;
--recursive-simplified-f: "ss03";
--recursive-simplified-g: "ss04";
--recursive-simplified-l: "ss05";
--recursive-simplified-r: "ss06";
--recursive-no-serif-L-Z: "ss08";
2023-08-18 17:04:12 +02:00
}
*,
*: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);
font-feature-settings:
var(--recursive-simplified-f), var(--recursive-simplified-g),
var(--recursive-simplified-l), var(--recursive-simplified-r),
var(--recursive-no-serif-L-Z);
2023-08-18 17:04:12 +02:00
}
h1 {
--recursive-wght: 900;
2023-08-18 18:26:41 +02:00
font-size: 4.8rem;
font-feature-settings: var(--recursive-simplified-r) 0;
2023-08-18 18:26:41 +02:00
}
h2 {
--recursive-wght: 850;
2023-08-18 18:26:41 +02:00
font-size: 3.2rem;
2023-08-18 18:26:41 +02:00
}
h3 {
--recursive-wght: 850;
2023-08-18 18:26:41 +02:00
font-size: 2.4rem;
2023-08-18 17:04:12 +02:00
}
2023-08-31 19:25:19 +02:00
h4 {
--recursive-wght: 800;
2023-08-31 19:25:19 +02:00
font-size: 1.6rem;
2023-08-31 19:25:19 +02:00
}
code {
--recursive-mono: 0.5;
}
2023-08-18 17:04:12 +02:00
pre,
pre code,
2024-02-16 22:01:19 +01:00
kbd,
2024-02-17 14:56:17 +01:00
th-literate-program {
--recursive-mono: 1;
2024-02-17 18:01:17 +01:00
--recursive-wght: 450;
tab-size: 4;
2023-08-18 18:26:41 +02:00
}
strong code {
--recursive-wght: 800;
}
2023-08-18 18:26:41 +02:00
b,
strong {
--recursive-wght: 700;
}
i,
em {
--recursive-slnt: -16;
2024-02-17 21:03:45 +01:00
font-style: normal;
2023-08-18 18:26:41 +02:00
}
h1,
h2,
h3,
h4,
h5,
h6 {
text-wrap: balance;
}
/* Other classes for controlling typography */
.nowrap {
white-space: nowrap;
}
2023-08-18 18:26:41 +02:00
/* Lay out elements a bit more compactly */
p,
pre {
2023-08-27 19:40:47 +02:00
margin: 0 0;
2023-08-18 18:26:41 +02:00
}
h1,
h2,
2023-08-31 19:25:19 +02:00
h3,
h4,
h5,
h6 {
margin: 0.4rem 0;
2023-08-18 18:26:41 +02:00
}
/* Make code examples a little prettier by giving them visual separation from the rest of the page */
2024-02-16 22:01:19 +01:00
code,
2024-02-17 14:56:17 +01:00
th-literate-program {
padding: 0.3rem 0.4rem;
2023-09-03 12:09:37 +02:00
background-color: var(--shaded-background);
border-radius: 0.4rem;
2023-09-03 12:09:37 +02:00
}
2024-02-17 14:56:17 +01:00
th-literate-program,
2024-02-16 22:01:19 +01:00
th-literate-output {
display: block;
}
kbd {
padding: 0.3rem 0.6rem;
border: 0.1rem solid var(--border-1);
border-radius: 0.4rem;
}
2024-02-16 22:01:19 +01:00
pre,
2024-02-17 14:56:17 +01:00
th-literate-program {
padding: 0.8rem 1.2rem;
margin: 1.2rem 0;
background-color: var(--shaded-background);
2025-08-30 13:13:29 +02:00
border-radius: 0.4em;
2024-02-08 13:49:22 +01:00
transition: background-color var(--transition-duration);
}
2024-02-17 21:03:45 +01:00
@media (prefers-color-scheme: light) {
pre,
th-literate-program {
background-color: transparent;
border: 0.1rem solid var(--border-1);
2024-02-17 21:03:45 +01:00
}
2023-08-18 18:26:41 +02:00
}
pre > code,
th-literate-program > code {
padding: 0;
2023-09-03 12:09:37 +02:00
background: none;
2024-06-13 21:50:09 +02:00
border-radius: 0;
2023-09-03 12:09:37 +02:00
}
2024-02-17 21:03:45 +01:00
th-literate-program {
white-space: pre;
}
2023-08-20 15:54:06 +02:00
/* And don't let code examples fly off and overflow the window */
2024-02-18 23:37:31 +01:00
pre,
th-literate-program {
2024-02-08 13:49:22 +01:00
min-width: 0;
width: auto;
overflow: auto;
2023-08-20 15:54:06 +02:00
}
/* Images */
2023-08-18 18:26:41 +02:00
img {
/* Prevent images from causing horizontal scrolling */
2023-08-18 18:26:41 +02:00
max-width: 100%;
height: auto;
2023-08-18 18:26:41 +02:00
}
2024-02-07 11:35:08 +01:00
img.pic {
border-radius: 0.6rem;
margin: 0.8rem 0;
2024-02-07 11:35:08 +01:00
}
2024-02-14 23:31:39 +01:00
img {
/* Hints for tweaking rendering */
&[src*="+pixel"] {
2024-02-17 21:03:45 +01:00
image-rendering: pixelated;
2024-02-14 23:31:39 +01:00
border-radius: 0;
}
2025-08-30 13:13:29 +02:00
&[src*="+illust"] {
border-radius: 0;
}
2024-02-17 21:03:45 +01:00
/* TODO: These could be autogenerated! */
&[src*="+width72"] {
width: 7.2rem;
2024-02-19 22:32:26 +01:00
height: auto;
}
&[src*="+width160"] {
width: 16rem;
2024-02-14 23:31:39 +01:00
height: auto;
}
&[src*="+width640"] {
width: 64rem;
2024-02-14 23:31:39 +01:00
height: auto;
}
&[src*="+width752"] {
width: 75.2rem;
2024-02-17 21:03:45 +01:00
height: auto;
}
2024-02-14 23:31:39 +01:00
/* Resources for use in JavaScript. */
&.resource {
display: none;
}
}
2023-08-18 18:26:41 +02:00
/* Fix the default blue and ugly purple links normally have */
a {
2023-08-27 17:01:27 +02:00
color: var(--link-color);
2023-08-18 18:26:41 +02:00
}
a:visited {
2023-08-27 17:01:27 +02:00
color: var(--link-color-visited);
2023-08-18 18:26:41 +02:00
}
2024-03-24 22:32:01 +01:00
a.secret {
color: var(--text-color);
text-decoration: none;
}
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: 0.4rem 1.2rem;
margin: 0.4rem 0;
border-left: 0.4rem solid var(--border-1);
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: 0.8rem 0;
2023-08-18 20:58:07 +02:00
}
2023-08-18 17:04:12 +02:00
2023-08-18 19:25:38 +02:00
table,
th,
td {
border: 0.1rem solid var(--border-2);
2023-08-18 19:25:38 +02:00
border-collapse: collapse;
padding: 0.4rem 1rem;
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;
2023-08-18 17:04:12 +02:00
}
2023-08-22 18:23:18 +02:00
2024-02-21 23:17:19 +01:00
/* Horizontal rules */
hr {
width: 100%;
border: none;
border-top: 0.1rem solid var(--border-1);
2024-02-21 23:17:19 +01:00
margin-top: 2em;
margin-bottom: 2em;
}
2025-08-31 12:06:28 +02:00
/* Buttons */
button {
padding: 0.2rem 1.2rem;
border: 1px solid var(--border-2);
background-color: color-mix(in oklab, var(--background-color), white 25%);
color: var(--text-color);
box-shadow: 0 1px 2px var(--border-1);
border-radius: 100px;
transition:
background-color var(--transition-duration) var(--ease-out-quintic),
box-shadow var(--transition-duration) var(--ease-out-quintic),
transform var(--transition-duration) var(--ease-out-quintic);
&:hover {
box-shadow: 0 4px 6px var(--border-1);
transform: translateY(-2px);
}
&:active {
background-color: color-mix(
in oklab,
var(--background-color),
var(--shading-base) 5%
);
box-shadow: 0 0 2px var(--border-1);
transform: translateY(0);
}
}
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: 1.6rem;
2023-08-22 18:23:18 +02:00
background-color: #fde748;
color: #55423e;
border: 0.1rem solid #6c581c;
border-radius: 0.8rem;
2023-08-22 18:23:18 +02:00
width: fit-content;
margin-left: auto;
margin-right: auto;
margin-top: 1.6rem;
margin-bottom: 1.6rem;
}
.noscript:empty {
display: none;
2023-08-22 18:23:18 +02:00
}
.noscript p {
margin-top: 0;
margin-bottom: 1.6rem;
2023-08-22 18:23:18 +02:00
}
.noscript p:last-child {
margin-bottom: 0;
}
2023-08-27 15:27:42 +02:00
2023-08-27 19:40:47 +02:00
.noscript a {
color: #004ec8;
2023-08-27 19:40:47 +02:00
}
.noscript a:visited {
color: #6c2380;
2023-08-27 19:40:47 +02:00
}
/* Feeds */
section.feed {
display: flex;
flex-direction: column;
/* Titles */
2025-08-24 13:18:51 +02:00
& h2 {
& a,
& a:visited {
color: var(--text-color);
}
2025-08-24 13:18:51 +02:00
& a:visited {
color: color-mix(
in srgb,
var(--background-color),
var(--text-color) 60%
);
}
}
& h1 {
--recursive-wght: 800;
font-size: 125%;
padding-top: 1.2rem;
padding-bottom: 1.2rem;
}
& h2 {
--recursive-wght: 600;
font-size: 100%;
padding: 0;
}
/* Articles */
& article {
display: flex;
flex-direction: column;
padding-bottom: 1.2rem;
line-height: 1.4;
& .info {
display: flex;
flex-direction: row;
flex-wrap: wrap;
font-size: 87.5%;
& > *:not(:first-child)::before {
content: "·";
padding: 0 0.4rem;
}
}
& .categories {
display: flex;
flex-direction: row;
flex-wrap: wrap;
list-style: none;
margin: 0;
padding: 0;
2025-08-24 13:18:51 +02:00
& > *:not(:first-child) {
padding-left: 1ch;
}
2025-08-24 13:18:51 +02:00
& a,
& a:visited {
color: var(--text-color);
}
}
}
}
/* Page sidebar */
2023-08-27 15:27:42 +02:00
aside.sidebar {
overflow: clip;
& > a {
display: block;
height: min-content;
margin-top: auto;
}
2023-08-27 15:27:42 +02:00
}
header.floof {
margin-top: auto;
2024-02-07 13:32:47 +01:00
position: relative;
& > img {
display: block;
min-width: 0;
object-fit: cover;
object-position: 33% 0;
}
& > h1 {
position: absolute;
top: 3rem;
left: 3rem;
display: flex;
flex-direction: column;
line-height: 1;
width: min-content;
--recursive-wght: 900;
font-size: 5.6rem;
text-align: right;
transform: skew(-5deg, -5deg);
& .rikis {
width: max-content;
background-color: var(--text-color);
color: var(--background-color);
padding: 0.1em;
--shadow-color: var(--accent-pink);
box-shadow:
0.5px 0.5px 0 var(--shadow-color),
1px 1px 0 var(--shadow-color),
1.5px 1.5px 0 var(--shadow-color),
2px 2px 0 var(--shadow-color),
2.5px 2.5px 0 var(--shadow-color),
3px 3px 0 var(--shadow-color),
3.5px 3.5px 0 var(--shadow-color),
4px 4px 0 var(--shadow-color);
/*
import math
print("box-shadow:")
x = 0
max_x = 16
while x < max_x:
print(f"{x}px {x}px {math.pow(x / max_x, 2) * 16}px rgba(from var(--shadow-color) r g b / {math.pow(1 - x / max_x, 3)}),")
x += 0.5
*/
/* prettier-ignore */
box-shadow:
0px 0px 0.0px rgba(from var(--shadow-color) r g b / 1.0),
0.5px 0.5px 0.015625px rgba(from var(--shadow-color) r g b / 0.909149169921875),
1.0px 1.0px 0.0625px rgba(from var(--shadow-color) r g b / 0.823974609375),
1.5px 1.5px 0.140625px rgba(from var(--shadow-color) r g b / 0.744293212890625),
2.0px 2.0px 0.25px rgba(from var(--shadow-color) r g b / 0.669921875),
2.5px 2.5px 0.390625px rgba(from var(--shadow-color) r g b / 0.600677490234375),
3.0px 3.0px 0.5625px rgba(from var(--shadow-color) r g b / 0.536376953125),
3.5px 3.5px 0.765625px rgba(from var(--shadow-color) r g b / 0.476837158203125),
4.0px 4.0px 1.0px rgba(from var(--shadow-color) r g b / 0.421875),
4.5px 4.5px 1.265625px rgba(from var(--shadow-color) r g b / 0.371307373046875),
5.0px 5.0px 1.5625px rgba(from var(--shadow-color) r g b / 0.324951171875),
5.5px 5.5px 1.890625px rgba(from var(--shadow-color) r g b / 0.282623291015625),
6.0px 6.0px 2.25px rgba(from var(--shadow-color) r g b / 0.244140625),
6.5px 6.5px 2.640625px rgba(from var(--shadow-color) r g b / 0.209320068359375),
7.0px 7.0px 3.0625px rgba(from var(--shadow-color) r g b / 0.177978515625),
7.5px 7.5px 3.515625px rgba(from var(--shadow-color) r g b / 0.149932861328125),
8.0px 8.0px 4.0px rgba(from var(--shadow-color) r g b / 0.125),
8.5px 8.5px 4.515625px rgba(from var(--shadow-color) r g b / 0.102996826171875),
9.0px 9.0px 5.0625px rgba(from var(--shadow-color) r g b / 0.083740234375),
9.5px 9.5px 5.640625px rgba(from var(--shadow-color) r g b / 0.067047119140625),
10.0px 10.0px 6.25px rgba(from var(--shadow-color) r g b / 0.052734375),
10.5px 10.5px 6.890625px rgba(from var(--shadow-color) r g b / 0.040618896484375),
11.0px 11.0px 7.5625px rgba(from var(--shadow-color) r g b / 0.030517578125),
11.5px 11.5px 8.265625px rgba(from var(--shadow-color) r g b / 0.022247314453125),
12.0px 12.0px 9.0px rgba(from var(--shadow-color) r g b / 0.015625),
12.5px 12.5px 9.765625px rgba(from var(--shadow-color) r g b / 0.010467529296875),
13.0px 13.0px 10.5625px rgba(from var(--shadow-color) r g b / 0.006591796875),
13.5px 13.5px 11.390625px rgba(from var(--shadow-color) r g b / 0.003814697265625),
14.0px 14.0px 12.25px rgba(from var(--shadow-color) r g b / 0.001953125),
14.5px 14.5px 13.140625px rgba(from var(--shadow-color) r g b / 0.000823974609375),
15.0px 15.0px 14.0625px rgba(from var(--shadow-color) r g b / 0.000244140625),
15.5px 15.5px 15.015625px rgba(from var(--shadow-color) r g b / 3.0517578125e-05)
;
}
& .fluffy-little-house {
display: flex;
flex-direction: column;
background-color: var(--background-color);
width: min-content;
align-self: end;
padding-left: 0.8rem;
padding-right: 0.8rem;
padding-top: 0.4rem;
z-index: -1;
color: var(--text-color);
& .adjectives {
--recursive-wght: 800;
font-size: 1.6rem;
padding-top: 0.6rem;
}
& .house {
margin-top: -0.2em;
font-size: 3.6rem;
}
}
}
2023-08-27 15:27:42 +02:00
}
2023-08-27 18:25:21 +02:00
/* Navigation header (contains page title & breadcrumbs) */
2024-02-07 13:32:47 +01:00
h1.page-title {
--recursive-wght: 900;
2024-11-01 19:12:44 +01:00
line-height: 1.2;
2025-08-24 13:18:51 +02:00
padding-top: 0.5lh;
padding-bottom: 0.5lh;
2024-03-03 21:43:01 +01:00
& a {
color: var(--text-color);
text-decoration: underline;
text-decoration-color: transparent;
transition: var(--transition-duration) text-decoration-color;
2024-03-03 21:43:01 +01:00
&:hover {
text-decoration-color: var(--text-color);
2024-03-03 21:43:01 +01:00
}
}
}
@media (hover: none) {
h1.page-title a {
text-decoration: underline;
}
2024-02-07 13:32:47 +01:00
}
@media (max-width: 700px) {
h1.page-title {
font-size: 4rem;
}
}
2024-02-21 23:17:19 +01:00
span.badge {
--recursive-wght: 800;
--recursive-mono: 1;
2024-02-21 23:17:19 +01:00
border-radius: 100rem;
padding: 0.2rem 0.6rem;
2024-02-21 23:17:19 +01:00
font-size: 0.9em;
&.red {
color: white;
background-color: #d01243;
}
2024-02-22 16:14:02 +01:00
&.blue {
color: white;
background-color: #058ef0;
}
2024-02-21 23:17:19 +01:00
&.before-content {
margin-right: 0.6rem;
2024-02-21 23:17:19 +01:00
}
}
/* Style the footer */
2024-02-08 22:41:01 +01:00
footer {
width: 100%;
max-width: 90ch;
padding: 1.6rem 0.8rem;
display: flex;
flex-direction: row;
& > .left {
flex-grow: 1;
}
& > .right {
flex-shrink: 0;
}
& #footer-icon {
display: block;
& > svg {
display: block;
color: var(--text-color);
opacity: 40%;
}
}
& #open-command-line {
width: 3.2rem;
height: 3.2rem;
background: none;
border: none;
padding: 0;
background-image: var(--icon-cmd);
background-repeat: no-repeat;
background-position: 50% 50%;
opacity: 50%;
transition: var(--transition-duration) opacity;
&:hover {
opacity: 100%;
}
2024-09-29 00:14:11 +02:00
&:active {
opacity: 75%;
2024-09-29 00:14:11 +02:00
}
2024-02-08 22:41:01 +01:00
}
}
footer.pink-space {
display: block;
max-width: none;
position: relative;
& .copyright {
position: absolute;
right: 0;
top: 0;
opacity: 70%;
padding: 1.6rem;
}
& pre.meow {
position: absolute;
right: 0;
bottom: 0;
width: min-content;
background: none;
border: none;
--recursive-wght: 700;
line-height: 1.3;
font-size: 75%;
opacity: 25%;
user-select: none;
}
}
2024-12-08 12:45:29 +01:00
/* Style dialogues */
dialog[open] {
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: var(--text-color);
background-color: var(--background-color);
border: 0.1rem solid var(--border-1);
border-radius: 1.2rem;
2024-12-08 12:45:29 +01:00
}
2023-08-27 18:25:21 +02:00
/* Style emojis to be readable */
2024-03-03 21:23:37 +01:00
img[data-cast~="emoji"] {
max-width: 1.3125em;
max-height: 1.3125em;
vertical-align: text-bottom;
2023-08-27 20:54:59 +02:00
object-fit: contain;
2023-08-27 18:25:21 +02:00
}
2023-08-27 18:47:57 +02:00
/* Tooltips */
2023-08-28 22:11:18 +02:00
th-overlays {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
th-tooltip {
display: block;
2023-08-28 22:11:18 +02:00
2024-02-20 21:50:24 +01:00
position: fixed;
2023-08-28 22:11:18 +02:00
width: max-content;
z-index: 100;
background-color: var(--background-color-tooltip);
padding: 0.4rem 0.8rem;
border-radius: 0.6rem;
2024-02-08 11:49:17 +01:00
transition:
opacity var(--transition-duration) cubic-bezier(0.22, 1, 0.36, 1),
filter var(--transition-duration) cubic-bezier(0.22, 1, 0.36, 1),
transform var(--transition-duration) cubic-bezier(0.22, 1, 0.36, 1);
opacity: 0%;
filter: blur(0.3rem);
2024-02-08 11:49:17 +01:00
pointer-events: none;
font-size: 0.9em;
&[th-side="bottom"] {
transform: translateX(-50%) translateY(-10%) scale(0.8);
&.transitioned-in {
transform: translateX(-50%) scale(1);
}
}
&[th-side="left"] {
transform: translateX(-90%) translateY(-50%) scale(0.8);
&.transitioned-in {
transform: translateX(-100%) translateY(-50%);
}
}
2023-08-28 22:11:18 +02:00
}
th-tooltip.transitioned-in {
2024-02-08 11:49:17 +01:00
opacity: 100%;
2024-06-13 21:50:09 +02:00
filter: blur(0);
2023-08-28 22:11:18 +02:00
}
th-tooltip.tooltip-emoji {
display: flex;
flex-direction: column;
align-items: center;
2023-08-28 22:11:18 +02:00
padding: 0.8rem;
margin-top: 0.8rem;
& > img {
display: block;
max-width: 7.2rem;
max-height: 7.2rem;
}
& > p {
color: var(--text-color);
margin: 0;
padding-top: 0.6rem;
line-height: 1;
}
2023-08-28 22:11:18 +02:00
}
2024-07-22 20:34:42 +02:00
.th-emoji-unknown {
text-decoration: 0.1rem underline var(--error-color);
2024-07-22 20:34:42 +02:00
cursor: help;
}
2024-12-08 12:45:29 +01:00
/* Command line */
2023-08-27 18:47:57 +02:00
2024-12-08 12:45:29 +01:00
th-command-line {
--recursive-mono: 1;
display: none;
flex-direction: column;
background-color: var(--background-color-tooltip);
font-size: 87.5%;
2023-08-27 18:47:57 +02:00
2024-12-08 12:45:29 +01:00
&.visible {
display: flex;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
2023-08-27 18:47:57 +02:00
}
2024-12-08 12:45:29 +01:00
& > .input-wrapper {
display: flex;
flex-direction: row;
align-items: center;
2024-12-08 12:45:29 +01:00
padding: 0 0.4rem;
2024-12-08 12:45:29 +01:00
width: 100%;
&::before {
content: ":";
padding-right: 0.2rem;
2024-12-08 12:45:29 +01:00
opacity: 50%;
}
& > input {
background: none;
color: var(--text-color);
border: none;
flex-grow: 1;
padding: 0.2rem 0;
2024-12-08 12:45:29 +01:00
&:focus {
outline: none;
}
}
2023-08-27 18:47:57 +02:00
}
2024-12-08 12:45:29 +01:00
& > ul.suggestions {
list-style: none;
display: flex;
flex-direction: column;
2023-08-27 18:47:57 +02:00
2024-12-08 12:45:29 +01:00
margin: 0;
padding: 0;
max-height: 25vh;
overflow: auto;
2024-12-08 12:45:29 +01:00
& > li {
padding: 0.2rem 0.8rem;
2024-12-08 12:45:29 +01:00
cursor: default;
& > dfn {
--recursive-crsv: 0;
--recursive-wght: 700;
margin-right: 2ch;
}
&:hover,
&.tabbed {
background-color: var(--accent-purple);
2024-12-08 12:45:29 +01:00
color: white;
}
&.immediate {
cursor: pointer;
}
}
}
}
@media (hover: none) {
th-command-line {
& > ul.suggestions > li {
border-bottom: 0.1rem solid var(--border-1);
}
}
}
@media (pointer: coarse) {
th-command-line {
& > .input-wrapper > input {
padding: 0.8rem 0;
}
& > ul.suggestions > li {
padding: 0.8rem 0.8rem;
2024-12-08 12:45:29 +01:00
}
}
2024-02-08 22:41:01 +01:00
}
2024-02-16 22:01:19 +01:00
/* Literate programming support */
2024-02-18 12:10:02 +01:00
:root {
--error-color: #d94141;
}
@media (prefers-color-scheme: dark) {
:root {
--error-color: #e39393;
}
}
2024-02-17 14:56:17 +01:00
th-literate-program[data-mode="input"] {
2024-02-16 22:01:19 +01:00
/* Override the cursor with an I-beam, because the editor captures clicks and does not bubble
them back up to the caller */
cursor: text;
}
2024-02-17 14:56:17 +01:00
th-literate-program[data-mode="output"] {
2024-02-18 00:29:58 +01:00
padding: 0;
background: none;
2024-02-18 12:10:02 +01:00
border: none;
2024-02-19 22:32:26 +01:00
border-radius: 0;
2024-02-18 00:29:58 +01:00
2024-02-20 23:30:36 +01:00
& iframe,
2024-02-21 23:26:53 +01:00
& img.placeholder-image {
2024-02-18 00:29:58 +01:00
border-style: none;
border-radius: 0.4rem;
2024-02-18 10:58:57 +01:00
display: block;
2024-02-21 23:17:19 +01:00
}
2024-04-07 18:11:56 +02:00
& iframe {
width: 100%;
}
2024-02-21 23:26:53 +01:00
& img.placeholder-image.js {
2024-02-20 23:30:36 +01:00
transition: opacity var(--transition-duration);
}
& iframe,
2024-02-21 23:26:53 +01:00
& img.placeholder-image.loading {
2024-02-20 23:30:36 +01:00
opacity: 50%;
}
& iframe.loaded {
opacity: 100%;
2024-02-18 00:29:58 +01:00
}
/* The inner iframe is hidden until something requests display. */
& iframe.hidden {
display: none;
}
2024-02-18 12:10:02 +01:00
& pre > code {
2024-02-18 23:37:31 +01:00
display: block;
}
2024-02-18 12:10:02 +01:00
& pre.error {
color: var(--error-color);
position: relative;
&:empty {
display: none;
}
&::after {
content: "Error";
2024-02-18 12:10:02 +01:00
padding: 0.8rem;
2024-02-18 12:10:02 +01:00
position: absolute;
right: 0;
top: 0;
color: var(--text-color);
opacity: 50%;
}
}
2024-02-18 23:37:31 +01:00
2024-02-21 23:26:53 +01:00
& pre.console,
& pre.placeholder-console {
2024-02-18 23:37:31 +01:00
position: relative;
2024-02-21 23:26:53 +01:00
margin-top: 0;
margin-bottom: 0;
2024-02-18 23:37:31 +01:00
&:empty {
display: none;
}
&::after {
content: "Console";
2024-02-18 23:37:31 +01:00
padding: 0.8rem;
2024-02-18 23:37:31 +01:00
position: absolute;
right: 0;
top: 0;
color: var(--text-color);
opacity: 50%;
}
}
2024-02-18 00:29:58 +01:00
}
2024-02-17 18:01:17 +01:00
/* Syntax highlighting */
:root {
2025-08-30 13:13:29 +02:00
--syntax-comment: #78579f;
2024-02-17 21:03:45 +01:00
--syntax-identifier: var(--text-color);
--syntax-keyword1: #b03b0d;
--syntax-keyword2: #02739d;
--syntax-operator: #ac4141;
--syntax-function: #9940b9;
--syntax-literal: #4c49a8;
--syntax-string: #2c7754;
--syntax-punct: #6c657b;
2024-02-17 18:01:17 +01:00
}
@media (prefers-color-scheme: dark) {
:root {
--syntax-comment: #a8a2b9;
2024-02-17 18:01:17 +01:00
--syntax-identifier: var(--text-color);
--syntax-keyword1: #ffb496;
--syntax-keyword2: #98dcfd;
--syntax-operator: #ffa5a5;
--syntax-function: #ffde9e;
--syntax-literal: #ffcaf4;
--syntax-string: #d6fbaa;
--syntax-punct: #a8a2b9;
2024-02-17 18:01:17 +01:00
}
}
.th-syntax-highlighting span {
&.comment {
2025-08-30 13:13:29 +02:00
--recursive-slnt: -8;
2024-02-17 18:01:17 +01:00
color: var(--syntax-comment);
}
&.identifier {
color: var(--syntax-identifier);
}
&.keyword1 {
color: var(--syntax-keyword1);
}
&.keyword2 {
color: var(--syntax-keyword2);
}
&.operator {
color: var(--syntax-operator);
}
&.function {
color: var(--syntax-function);
}
&.literal {
color: var(--syntax-literal);
}
&.string {
color: var(--syntax-string);
}
&.punct {
color: var(--syntax-punct);
}
2024-02-17 21:03:45 +01:00
2024-03-12 20:03:00 +01:00
&.error {
color: var(--error-color);
text-decoration: wavy underline;
}
2024-05-18 13:41:43 +02:00
&.hidden {
display: none;
}
&.type-hint {
color: var(--syntax-comment);
font-size: 80%;
}
2024-02-17 21:03:45 +01:00
}
2025-08-30 13:13:29 +02:00
.th-syntax-highlighting th-comment-columns {
display: grid;
grid-template-columns: repeat(2, max-content);
}
2024-02-17 21:03:45 +01:00
.th-syntax-highlighting {
& .export {
text-decoration: underline dotted;
cursor: help;
text-decoration-color: transparent;
transition: text-decoration-color var(--transition-duration);
}
&:hover,
&:focus {
& .export {
text-decoration-color: var(--syntax-keyword1);
}
}
2024-02-17 18:01:17 +01:00
}
2024-02-21 23:17:19 +01:00
/* Style settings sections */
2024-03-03 21:23:37 +01:00
section[data-cast~="settings"] {
2024-02-21 23:17:19 +01:00
/* Don't display settings when JavaScript is disabled.
JS overrides this value on the element itself. */
display: none;
2024-03-02 20:53:44 +01:00
}