mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-03-19 12:43:38 +09:00
596 lines
12 KiB
CSS
596 lines
12 KiB
CSS
.message-area {
|
|
display: contents;
|
|
|
|
&:has(.message) {
|
|
.message-area--empty {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
&:not(:has(.message)) {
|
|
--opacity: 0.2;
|
|
|
|
block-size: 100vh;
|
|
display: grid;
|
|
place-content: center stretch;
|
|
place-items: center center;
|
|
|
|
> * {
|
|
grid-area: 1/1;
|
|
}
|
|
|
|
.message-area--empty > figure img {
|
|
inline-size: 30dvw;
|
|
}
|
|
}
|
|
}
|
|
|
|
.message-area__return-to-latest {
|
|
animation: pulsing-outline 2s infinite both;
|
|
outline: 0 solid var(--color-selected-dark);
|
|
inset-block-end: var(--footer-height);
|
|
inset-inline-start: calc(50% - calc(var(--btn-size) / 2));
|
|
position: absolute;
|
|
}
|
|
|
|
#system_welcome {
|
|
--avatar-size: 5ch;
|
|
|
|
display: block;
|
|
margin-block-start: calc(var(--avatar-size) * 2);
|
|
position: relative;
|
|
z-index: 1;
|
|
|
|
.avatar {
|
|
margin-block-start: calc(var(--avatar-size) * -0.5);
|
|
}
|
|
|
|
.message__body {
|
|
display: block;
|
|
max-inline-size: unset;
|
|
}
|
|
|
|
.message__body-content {
|
|
overflow: unset;
|
|
}
|
|
|
|
.system-welcome--translation {
|
|
inset-block-start: var(--block-space);
|
|
inset-inline-start: var(--block-space);
|
|
position: absolute;
|
|
}
|
|
|
|
.invite-label,
|
|
.btn--regenerate {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
.messages {
|
|
--message-column-gap: 0.66ch;
|
|
--message-row-gap: 0.1em;
|
|
--message-space: 1.33em;
|
|
|
|
display: grid;
|
|
flex: 1;
|
|
grid-auto-rows: min-content;
|
|
overflow-y: auto;
|
|
overscroll-behavior: contain;
|
|
position: relative;
|
|
row-gap: var(--message-space);
|
|
|
|
@media (max-width: 100ch) {
|
|
padding-block-start: var(--navbar-height);
|
|
}
|
|
}
|
|
|
|
.message {
|
|
--content-padding-block: 0.66rem;
|
|
--content-padding-inline: calc(var(--inline-space) * 1.5);
|
|
|
|
column-gap: var(--message-column-gap);
|
|
display: grid;
|
|
grid-auto-columns: var(--inline-space-double) 1fr min-content;
|
|
grid-auto-rows: min-content;
|
|
grid-template-areas:
|
|
"sep sep sep"
|
|
"avatar body body";
|
|
padding-inline: calc(var(--inline-space) + 1vw);
|
|
position: relative;
|
|
row-gap: var(--message-row-gap);
|
|
visibility: hidden;
|
|
z-index: 0;
|
|
|
|
.message__boost-inline {
|
|
display: none;
|
|
}
|
|
|
|
&:last-of-type {
|
|
&:has(.boost__reactions) {
|
|
.message__body {
|
|
padding-block-end: 3.2rem;
|
|
}
|
|
}
|
|
}
|
|
|
|
&.message--formatted {
|
|
visibility: visible;
|
|
}
|
|
|
|
&:has([open]) {
|
|
z-index: 1;
|
|
|
|
.message__options-btn {
|
|
opacity: 1;
|
|
}
|
|
|
|
.message__actions-menu {
|
|
display: block;
|
|
}
|
|
}
|
|
|
|
&:has(.boost-item) {
|
|
.message__boost-inline {
|
|
display: inline-flex;
|
|
}
|
|
}
|
|
|
|
+ .message--threaded {
|
|
margin-block-start: calc((var(--message-space) + (var(--message-row-gap) * 2) - 2px) * -1);
|
|
}
|
|
|
|
&.message--failed {
|
|
opacity: 0.5;
|
|
|
|
.message__meta::after {
|
|
content: "🚫";
|
|
font-size: 1em;
|
|
line-height: 1;
|
|
}
|
|
|
|
.message__body-content {
|
|
animation: wiggle 0.4s both;
|
|
outline: 1px dashed var(--color-negative);
|
|
}
|
|
}
|
|
}
|
|
|
|
.message__day-separator {
|
|
align-items: center;
|
|
display: none;
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
grid-area: sep;
|
|
grid-template-columns: 1fr auto 1fr;
|
|
inline-size: 100%;
|
|
margin-block: var(--message-space);
|
|
text-align: center;
|
|
text-transform: uppercase;
|
|
visibility: hidden;
|
|
|
|
time,
|
|
span {
|
|
padding: 0.66em 2.33ch;
|
|
background-color: var(--color-message-bg);
|
|
border-radius: 3em;
|
|
}
|
|
|
|
&::after,
|
|
&::before {
|
|
border-top: 2px solid var(--color-message-bg);
|
|
content: "";
|
|
}
|
|
|
|
.message--first-of-day & {
|
|
display: grid;
|
|
visibility: visible;
|
|
}
|
|
}
|
|
|
|
.message__avatar {
|
|
--avatar-border-size: 1px;
|
|
--avatar-size: 3.5ch;
|
|
|
|
grid-area: avatar;
|
|
z-index: 2;
|
|
display: flex;
|
|
box-shadow: 0 0 0 var(--hover-size) var(--color-bg);
|
|
}
|
|
|
|
.message__meta {
|
|
align-items: center;
|
|
column-gap: calc(var(--message-column-gap) / 2);
|
|
display: flex;
|
|
justify-content: start;
|
|
line-height: 1.5;
|
|
min-inline-size: 0;
|
|
margin: 0;
|
|
padding-inline-end: calc(var(--btn-size) / 2);
|
|
|
|
.message__room {
|
|
display: none;
|
|
visibility: hidden;
|
|
}
|
|
|
|
.message__heading {
|
|
align-items: center;
|
|
column-gap: calc(var(--message-column-gap) / 2);
|
|
display: inline-flex;
|
|
margin: 0;
|
|
min-inline-size: 0;
|
|
}
|
|
|
|
.message__actions {
|
|
@media (max-width: 100ch) {
|
|
.message__options-btn {
|
|
--btn-padding: 0 0.5em;
|
|
|
|
aspect-ratio: unset;
|
|
block-size: auto;
|
|
border-radius: 0.3em;
|
|
}
|
|
}
|
|
|
|
@media (min-width: 100ch) {
|
|
inset-block-start: 50%;
|
|
inset-inline-start: calc(100% + var(--message-column-gap) / 2);
|
|
position: absolute;
|
|
transform: translate(0, -50%);
|
|
}
|
|
}
|
|
}
|
|
|
|
.message__author {
|
|
font-size: 0.8rem;
|
|
font-weight: 400;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.message__permalink {
|
|
color: var(--color-text);
|
|
font-size: 0.8rem;
|
|
font-weight: 400;
|
|
opacity: 0.5;
|
|
text-decoration: none;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.message__body {
|
|
column-gap: var(--inline-space-half);
|
|
display: flex;
|
|
grid-area: body;
|
|
max-inline-size: min(80ch, 85%);
|
|
position: relative;
|
|
|
|
.message--me & {
|
|
flex-direction: row-reverse;
|
|
}
|
|
|
|
@media (max-width: 100ch) {
|
|
max-inline-size: 100%;
|
|
}
|
|
}
|
|
|
|
.message__body-content {
|
|
background-color: var(--message-background, var(--color-message-bg));
|
|
border-radius: 0.66em;
|
|
color: var(--message-color, var(--color-text));
|
|
font-weight: 400;
|
|
inline-size: fit-content;
|
|
margin-block-end: var(--message-row-gap);
|
|
max-inline-size: 100%;
|
|
padding: var(--content-padding-block) var(--content-padding-inline);
|
|
position: relative;
|
|
word-break: break-word;
|
|
|
|
&:has(.message__attachment) {
|
|
margin-block-end: 0.33em;
|
|
padding: 0;
|
|
|
|
&:has(.boost) {
|
|
padding-block-end: var(--block-space-half);
|
|
|
|
.boosts {
|
|
padding-inline: var(--inline-space);
|
|
}
|
|
}
|
|
|
|
.message__meta {
|
|
padding: var(--content-padding-block) var(--content-padding-inline);
|
|
}
|
|
}
|
|
|
|
&.message__body-content--editing:has(.message__attachment) {
|
|
max-inline-size: calc(100% - var(--btn-size));
|
|
}
|
|
|
|
&:has(.message__pending-upload) {
|
|
padding: 0;
|
|
}
|
|
}
|
|
|
|
.message__attachment {
|
|
block-size: auto;
|
|
border: 1px solid var(--color-border);
|
|
border-radius: 0.66em;
|
|
|
|
.message__body-content:has(.boost) & {
|
|
border-end-start-radius: 0;
|
|
border-end-end-radius: 0;
|
|
}
|
|
|
|
.message:not(.message--threaded) & {
|
|
border-start-end-radius: 0;
|
|
border-start-start-radius: 0;
|
|
}
|
|
}
|
|
|
|
img.message__attachment {
|
|
cursor: zoom-in;
|
|
}
|
|
|
|
.message__actions {
|
|
align-content: center;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
justify-content: start;
|
|
z-index: 3;
|
|
}
|
|
|
|
.message__action-btn {
|
|
--btn-background: transparent;
|
|
--btn-border-color: transparent;
|
|
--outline-offset: 0;
|
|
--width: 33%;
|
|
|
|
flex-basis: var(--width);
|
|
font-size: 0.8rem;
|
|
|
|
@media (hover: hover) and (pointer: fine) {
|
|
&:where(:not(:active):hover) {
|
|
--btn-background: var(--color-border-dark);
|
|
--hover-size: 0;
|
|
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
&:where(:not(:active)):focus-visible {
|
|
opacity: 1;
|
|
}
|
|
|
|
.message__actions-grid & {
|
|
padding: 0.5em;
|
|
|
|
&:where(:has(> :last-child:nth-child(1))) & {
|
|
--width: 100%;
|
|
}
|
|
|
|
&:where(:has(> :last-child:nth-child(even))) & {
|
|
--width: 50%;
|
|
}
|
|
}
|
|
}
|
|
|
|
.message__edit-btn {
|
|
display: none;
|
|
|
|
.admin &,
|
|
.message--me & {
|
|
display: inline-flex;
|
|
}
|
|
}
|
|
|
|
.message__options-btn {
|
|
@media (hover: hover) and (pointer: fine) {
|
|
opacity: 0;
|
|
transition: opacity 150ms ease-in-out;
|
|
transition-delay: 150ms;
|
|
|
|
.message:hover & {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
@media (hover: none) and (pointer: coarse) {
|
|
opacity: 0.5;
|
|
|
|
& [open] {
|
|
opacity: 1;
|
|
}
|
|
}
|
|
}
|
|
|
|
.message__actions-menu {
|
|
--arrow-size: 1.5em;
|
|
--boost-border-color: var(--color-selected-dark);
|
|
--border-color: var(--color-border-darker);
|
|
--border-size: 1px;
|
|
|
|
background-color: var(--color-bg);
|
|
border-radius: calc(var(--arrow-size) / 2);
|
|
display: none;
|
|
inset: var(--btn-size) auto auto 50%;
|
|
padding: var(--inline-space-half);
|
|
position: absolute;
|
|
transform: translateX(-50%);
|
|
transform-origin: top left;
|
|
|
|
&::before {
|
|
aspect-ratio: 2;
|
|
background: var(--border-color);
|
|
clip-path: polygon(50% 0, 100% 100%, 0 100%);
|
|
inline-size: var(--arrow-size);
|
|
content: "";
|
|
display: block;
|
|
inset-block-start: calc(var(--arrow-size) / -2);
|
|
inset-inline-start: 50%;
|
|
position: absolute;
|
|
transform: translateX(-50%);
|
|
}
|
|
|
|
&::after {
|
|
aspect-ratio: 2;
|
|
background: var(--color-bg);
|
|
clip-path: polygon(50% 0, 100% 100%, 0 100%);
|
|
inline-size: var(--arrow-size);
|
|
content: "";
|
|
display: block;
|
|
inset-block-start: calc((var(--arrow-size) / -2) + var(--border-size) * 1.5);
|
|
inset-inline-start: 50%;
|
|
position: absolute;
|
|
transform: translateX(-50%);
|
|
}
|
|
|
|
@media (max-width: 100ch) {
|
|
inset-block-start: calc(var(--btn-size) / 1.5);
|
|
}
|
|
|
|
.popup-orientation-top & {
|
|
inset-block-end: var(--btn-size);
|
|
inset-block-start: auto;
|
|
transform-origin: bottom left;
|
|
|
|
&::before {
|
|
clip-path: polygon(50% 100%, 100% 0, 0 0);
|
|
inset-block-end: auto;
|
|
inset-block-start: 100%;
|
|
}
|
|
|
|
&::after {
|
|
clip-path: polygon(50% 100%, 100% 0, 0 0);
|
|
inset-block-end: auto;
|
|
inset-block-start: calc(100% - var(--border-size) * 1.5);
|
|
}
|
|
|
|
@media (max-width: 100ch) {
|
|
inset-block-end: calc(var(--btn-size) / 1.5);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Me */
|
|
.message--me {
|
|
grid-auto-columns: min-content 1fr var(--inline-space-double);
|
|
grid-template-areas:
|
|
"sep sep sep"
|
|
"body body avatar";
|
|
|
|
:is(.message__body, .message__meta, .message__heading) {
|
|
justify-self: end;
|
|
}
|
|
|
|
:is(.message__meta, .message__heading) {
|
|
flex-direction: row-reverse;
|
|
justify-content: end;
|
|
}
|
|
|
|
.message__meta {
|
|
padding-inline: calc(var(--btn-size) / 2) 0;
|
|
}
|
|
|
|
.message__avatar {
|
|
margin-inline: calc(var(--content-padding-inline) * -1) 0;
|
|
}
|
|
|
|
.message__actions {
|
|
justify-content: end;
|
|
|
|
@media (min-width: 100ch) {
|
|
inset-inline-end: calc(100% + var(--message-column-gap) / 2);
|
|
inset-inline-start: auto;
|
|
}
|
|
}
|
|
}
|
|
|
|
.message--mentioned {
|
|
.message__body-content {
|
|
--message-background: oklch(var(--lch-red) / 0.1);
|
|
|
|
animation: wiggle 0.4s both;
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
--message-background: oklch(var(--lch-red) / 0.2);
|
|
}
|
|
}
|
|
}
|
|
|
|
.message--threaded {
|
|
.message__author,
|
|
.message__avatar {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
.message__edit-btns div:only-of-type {
|
|
margin-inline: auto;
|
|
}
|
|
|
|
.message--emoji:not(:has(.composer--edit)) {
|
|
.message__body-content {
|
|
--message-background: transparent;
|
|
|
|
border-radius: 0;
|
|
margin-block-end: 0;
|
|
padding: var(--content-padding-block) 0 var(--content-padding-block) var(--content-padding-inline);
|
|
text-shadow: 0 0 3px var(--color-text-reversed);
|
|
|
|
.trix-content {
|
|
font-size: 2.4em;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.message--me & {
|
|
padding: var(--content-padding-block) var(--content-padding-inline) var(--content-padding-block) 0;
|
|
text-align: right;
|
|
}
|
|
|
|
:is(.message--threaded) & {
|
|
padding-block-start: 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
.message.search-highlight {
|
|
.message__body-content {
|
|
border: 2px solid var(--color-text);
|
|
animation: border-fade-out 0.5s 1s forwards;
|
|
}
|
|
}
|
|
|
|
/* Pending uploads */
|
|
.message__pending-upload {
|
|
border-radius: 0.66em;
|
|
overflow: hidden;
|
|
padding: var(--content-padding-block) var(--content-padding-inline);
|
|
position: relative;
|
|
|
|
&::before {
|
|
background-color: var(--color-border-dark);
|
|
block-size: 100%;
|
|
content: "";
|
|
inline-size: 100%;
|
|
inset-inline-start: var(--percentage);
|
|
position: absolute;
|
|
transform: translateX(-100%);
|
|
z-index: 1;
|
|
}
|
|
|
|
> div {
|
|
z-index: 2;
|
|
}
|
|
|
|
span {
|
|
inline-size: 3rem;
|
|
display: inline-block;
|
|
}
|
|
|
|
.composer__file-thumbnail {
|
|
aspect-ratio: 1;
|
|
background-size: contain;
|
|
inline-size: 1.4em;
|
|
}
|
|
}
|