treehouse/static/css/noncritical.css

324 lines
6 KiB
CSS
Raw Permalink Normal View History

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
}
/* Command line */
2023-08-27 18:47:57 +02:00
2024-12-08 12:45:29 +01:00
th-command-line {
font-family: var(--font-code);
2024-12-08 12:45:29 +01:00
--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;
2025-10-03 16:01:58 +02:00
font-weight: 700;
2024-12-08 12:45:29 +01:00
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 */
2025-10-06 14:43:02 +02:00
th-literate-program,
th-literate-output {
display: block;
2024-02-18 12:10:02 +01:00
}
2025-10-06 14:43:02 +02:00
th-literate-program {
white-space: pre;
2024-02-18 12:10:02 +01:00
}
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 {
--recursive-slnt: -8;
2025-10-03 16:01:58 +02:00
font-style: oblique 8deg;
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
}