264 lines
5.6 KiB
CSS
264 lines
5.6 KiB
CSS
@layer components {
|
|
.terminal {
|
|
--row-gap: 0.2lh;
|
|
|
|
background-color: var(--color-terminal-bg);
|
|
color: var(--color-terminal-text);
|
|
font-family: var(--font-mono);
|
|
font-size: 0.9em;
|
|
inset: auto 0 0 0;
|
|
max-block-size: 100%;
|
|
padding: var(--block-space) calc(var(--tray-size) + calc(var(--inline-space) * 3)) calc(var(--block-space) + env(safe-area-inset-bottom));
|
|
position: fixed;
|
|
z-index: var(--z-terminal);
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
border-block-start: 1px solid var(--color-ink-lighter);
|
|
}
|
|
}
|
|
|
|
.terminal__button {
|
|
--btn-background: var(--color-terminal-bg);
|
|
--btn-color: var(--color-terminal-text);
|
|
--btn-border-radius: 0;
|
|
--btn-border-color: var(--color-terminal-text);
|
|
--btn-padding: 0.1em 0.7em;
|
|
--btn-border-size: 1px;
|
|
|
|
font-family: var(--font-mono);
|
|
font-size: var(--text-x-small);
|
|
white-space: nowrap;
|
|
|
|
&:where(:not(:active)):focus-visible {
|
|
outline: 2px solid var(--color-terminal-text);
|
|
}
|
|
}
|
|
|
|
.terminal__command {
|
|
--btn-background: transparent;
|
|
--btn-color: var(--color-terminal-text);
|
|
|
|
font-weight: normal;
|
|
overflow: hidden;
|
|
transition: unset;
|
|
|
|
span:first-letter {
|
|
text-transform: capitalize;
|
|
}
|
|
}
|
|
|
|
.terminal__container {
|
|
max-block-size: calc(100vh - var(--btn-size) - var(--block-space));
|
|
overflow: auto;
|
|
}
|
|
|
|
.terminal__help {
|
|
background: var(--color-terminal-bg);
|
|
border-radius: 1em;
|
|
display: none;
|
|
|
|
inline-size: auto;
|
|
inset: 50% auto auto 50%;
|
|
max-inline-size: 90vw;
|
|
|
|
padding: calc(var(--block-space) * 1.5) var(--block-space-double);
|
|
position: fixed;
|
|
transform: translate(-50%, -50%);
|
|
|
|
.terminal--showing-help &,
|
|
.terminal--open .terminal__menu:empty ~ & {
|
|
display: block;
|
|
}
|
|
|
|
h2 {
|
|
border-block-end: 1px dashed;
|
|
font-size: var(--text-normal);
|
|
font-weight: normal;
|
|
margin-block: 0 0.5lh;
|
|
padding-block-end: 0.5lh;
|
|
}
|
|
|
|
h3 {
|
|
font-size: var(--text-small);
|
|
margin-block: 0;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
dl {
|
|
display: grid;
|
|
grid-template-columns: min-content 1fr;
|
|
gap: var(--inline-space);
|
|
font-size: var(--text-small);
|
|
margin: 0;
|
|
}
|
|
|
|
dt {
|
|
grid-column: 1;
|
|
margin-inline-start: var(--inline-space-double);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
dd {
|
|
grid-column: 2;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
|
|
.terminal__input {
|
|
--input-border-color: transparent;
|
|
--input-border-radius: 0.3em;
|
|
--input-color: var(--color-terminal-text);
|
|
|
|
accent-color: var(--color-terminal-text);
|
|
caret-color: var(--color-terminal-text);
|
|
font-family: inherit;
|
|
font-weight: 500;
|
|
text-align: start;
|
|
|
|
&.lexical-editor--empty {
|
|
overflow: hidden;
|
|
text-align: center;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
|
|
&:focus-within {
|
|
text-align: start;
|
|
|
|
.lexical-editor__content::before {
|
|
inset-inline-start: 0;
|
|
translate: 0 -50%;
|
|
}
|
|
}
|
|
|
|
.lexical-editor__content::before {
|
|
color: var(--color-ink);
|
|
inset: 50% auto auto 50%;
|
|
opacity: 0.5;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
transition: 200ms var(--ease-out-expo);
|
|
transition-property: inset-inline-start, translate;
|
|
translate: -50% -50%;
|
|
white-space: nowrap;
|
|
|
|
@starting-style {
|
|
inset: 0 0 0 50%;
|
|
transform: translateX(-50%);
|
|
}
|
|
}
|
|
}
|
|
|
|
.terminal--busy:is(:not(.terminal--confirmation)) & {
|
|
animation: pulse 1.5s infinite;
|
|
}
|
|
|
|
.terminal--confirmation & {
|
|
color: var(--color-terminal-text-light);
|
|
}
|
|
|
|
.terminal--error & {
|
|
accent-color: var(--color-negative);
|
|
caret-color: var(--color-negative);
|
|
color: var(--color-negative);
|
|
}
|
|
|
|
.lexical-editor__content {
|
|
min-block-size: initial;
|
|
margin: 0;
|
|
|
|
b, strong, i, em {
|
|
font-weight: inherit;
|
|
font-style: inherit;
|
|
}
|
|
|
|
ul, li {
|
|
list-style: none;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
.terminal__menu {
|
|
display: none;
|
|
list-style: none;
|
|
|
|
.terminal--open & {
|
|
display: flex;
|
|
}
|
|
|
|
.terminal--showing-help & {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
.terminal__item {
|
|
&[aria-selected] {
|
|
--btn-color: var(--color-terminal-bg);
|
|
|
|
background: var(--color-terminal-text);
|
|
color: var(--color-terminal-bg);
|
|
outline: 2px solid var(--color-terminal-text);
|
|
|
|
.terminal__command {
|
|
color: var(--color-terminal-bg);
|
|
}
|
|
}
|
|
|
|
@media (any-hover: hover) {
|
|
&:where(:not(:active):hover) {
|
|
background: color-mix(in srgb, var(--color-terminal-text) 20%, var(--color-terminal-bg));
|
|
}
|
|
}
|
|
}
|
|
|
|
.terminal__output {
|
|
display: none;
|
|
overflow-y: auto;
|
|
padding-inline: var(--inline-space);
|
|
|
|
.terminal--confirmation & {
|
|
color: var(--color-terminal-text-light);
|
|
}
|
|
|
|
.terminal--error & {
|
|
color: var(--color-negative);
|
|
}
|
|
|
|
.terminal--showing-output & {
|
|
display: block;
|
|
}
|
|
|
|
p {
|
|
+ ul {
|
|
margin-block-start: 0;
|
|
}
|
|
|
|
&:has(+ ul) {
|
|
margin-block-end: 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
.terminal__modal {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
margin: auto 15rem;
|
|
margin-bottom: 3.55rem;
|
|
height: calc(100vh - 15rem);
|
|
}
|
|
|
|
/* Lexical prompt insertions
|
|
/* ------------------------------------------------------------------------ */
|
|
|
|
.terminal {
|
|
action-text-attachment:not(.node--selected) {
|
|
--attachment-bg-color: oklch(var(--lch-white) / 15%);
|
|
--attachment-text-color: var(--color-terminal-text);
|
|
}
|
|
}
|
|
}
|