Files
once-campfire/app/assets/stylesheets/composer.css
T
2026-07-20 15:10:54 +02:00

196 lines
4.0 KiB
CSS

/* Composer */
.composer {
flex: none;
padding: var(--block-space-half) calc(var(--inline-space) + 1vw);
}
.composer__input-hint,
.composer__context-btn {
.composer:has(.composer__input:focus-within) & {
@media (max-width: 100ch) {
display: none;
}
}
}
/* Attachments */
.composer__attachment-btn {
--hover-filter: brightness(0.85);
@media (any-hover: hover) {
&:where(:not(:active):hover) {
filter: var(--hover-filter);
box-shadow: none;
}
}
}
/* Pending attachments */
.composer__filelist {
--row-gap: var(--block-space-half);
&:not(:empty) {
padding-block-end: var(--block-space-half);
}
}
.composer__file {
--aspect-ratio: 5/4;
--btn-border-radius: 1em;
--thumbnail-size: 15ch;
aspect-ratio: var(--aspect-ratio);
inline-size: var(--thumbnail-size);
}
:is(img, span):is(.composer__file-thumbnail) {
aspect-ratio: var(--aspect-ratio);
block-size: auto;
border-radius: var(--btn-border-radius);
border: 1px solid var(--color-border-darker);
inline-size: var(--thumbnail-size);
object-fit: cover;
}
.composer__file-thumbnail--common {
background: url(common-file-text.svg) no-repeat center;
background-size: 55%;
}
.composer__file-caption {
--icon-size: 1.3em;
&::after {
content: "";
block-size: var(--icon-size);
inline-size: var(--icon-size);
background: url("remove-circle.svg") no-repeat center;
margin-inline: 0.5em -0.5em;
flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
&::after {
filter: invert(100%);
}
}
}
/* Rich text */
.composer__rich-text-btn {
--hover-filter: brightness(0.85);
display: none;
@media (any-hover: hover) {
&:where(:not(:active):hover) {
filter: var(--hover-filter);
box-shadow: none;
}
}
img {
inline-size: 1.7em;
}
}
@media (min-width: 100ch) and (any-hover: hover) and (pointer: fine) {
.composer__rich-text-btn {
display: inline-flex;
}
.composer--rich-text {
lexxy-toolbar {
display: flex;
}
lexxy-editor.input {
margin-block-start: var(--block-space-half);
}
}
/* In the message composer the toolbar goes below the text, on the same
row as the surrounding action buttons, like the Trix toolbar did.
The edit composer keeps it on top. */
#composer.composer--rich-text lexxy-editor.input {
display: flex;
flex-direction: column;
/* Sit the toolbar row on the same baseline as the composer's round
buttons, which pull themselves down with negative margins */
margin-block-end: -0.25em;
.lexxy-editor__content {
order: -1;
}
lexxy-toolbar {
margin-block-start: 0.4em;
/* Dropdowns open upward — the toolbar sits at the bottom of the screen */
[data-dropdown-panel] {
inset-block-start: auto;
inset-block-end: 100%;
}
}
}
.composer--edit lexxy-toolbar {
border-block-end: 1px solid var(--color-border);
margin-inline: -0.8em;
padding-inline: 0.3em;
padding-block-end: 0.5em;
}
}
/* The editor's container-type prevents it from sizing the message bubble by
its content, so give the bubble the full available width while editing */
.message__body:has(.composer--edit) {
inline-size: 100%;
.message__body-content--editing {
flex-grow: 1;
}
}
/* Typing indicator */
.typing-indicator {
inset-block-start: var(--indicator-position, 0.15rem);
inset-inline-start: var(--block-space);
opacity: var(--indicator-opacity, 0);
position: absolute;
transition: inset-block-start 300ms ease,
opacity 300ms ease;
.sidebar & {
@media (min-width: 100ch) {
margin-inline-start: 2vw;
}
}
&.typing-indicator--active {
--indicator-position: 0.15rem;
--indicator-opacity: 1;
}
}
.typing-indicator__author {
line-height: 1;
padding-inline-start: 1.5em;
&.spinner {
display: none;
.typing-indicator--active & {
display: block;
}
}
}
.composer__input {
.composer__rich-text-btn,
label:has(input[type="file"]) {
cursor: pointer;
}
}