mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-03-13 21:55:15 +09:00
340 lines
6.9 KiB
CSS
340 lines
6.9 KiB
CSS
/* Sidebar */
|
|
:root {
|
|
--sidebar-inline-space: max(calc(var(--inline-space) * 1.5), 1vw);
|
|
--sidebar-tools-height: calc(var(--block-space) + var(--btn-size) + (var(--block-space) * 2));
|
|
}
|
|
|
|
.sidebar__container {
|
|
block-size: 100dvh;
|
|
max-block-size: 100dvh;
|
|
padding-block-end: var(--sidebar-tools-height);
|
|
}
|
|
|
|
.sidebar__tools {
|
|
-webkit-backdrop-filter: blur(12px);
|
|
backdrop-filter: blur(12px);
|
|
inset: auto 0 0 0;
|
|
padding-block: calc(var(--block-space) * 1.5);
|
|
padding-inline: var(--sidebar-inline-space);
|
|
position: fixed;
|
|
|
|
@media (min-width: 100ch) {
|
|
inline-size: calc(var(--sidebar-width));
|
|
inset-inline-start: auto;
|
|
}
|
|
}
|
|
|
|
.sidebar__toggle {
|
|
inset-block-start: var(--block-space-half);
|
|
inset-inline-start: calc((var(--btn-size) + max(var(--inline-space), 1vw)) * -1);
|
|
position: absolute;
|
|
transition:
|
|
inset-inline-start 300ms ease,
|
|
border-color 300ms ease,
|
|
background-color 300ms ease;
|
|
z-index: 5;
|
|
|
|
#sidebar:where(:not(.open):has(.unread)) & {
|
|
&::after {
|
|
--size: 1em;
|
|
|
|
aspect-ratio: 1;
|
|
background-color: var(--color-negative);
|
|
block-size: var(--size);
|
|
border-radius: calc(var(--size) * 2);
|
|
content: "";
|
|
flex-shrink: 0;
|
|
inline-size: var(--size);
|
|
inset-block-start: calc(var(--size) / -4);
|
|
inset-inline-end: calc(var(--size) / -4);
|
|
position: absolute;
|
|
}
|
|
}
|
|
|
|
@media (min-width: 100ch) {
|
|
display: none;
|
|
inset-block-start: var(--block-space);
|
|
}
|
|
|
|
.open & {
|
|
inset-block-start: var(--block-space);
|
|
|
|
@media (max-width: 100ch) {
|
|
inset-inline-start: var(--sidebar-inline-space);
|
|
|
|
& img {
|
|
filter: invert(0);
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
& img {
|
|
filter: invert(100%);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Direct messsages */
|
|
.directs {
|
|
--btn-border-color: var(--color-border-darker);
|
|
--column-gap: calc(var(--inline-space) / 1.5);
|
|
|
|
-webkit-backdrop-filter: blur(12px);
|
|
backdrop-filter: blur(12px);
|
|
display: grid;
|
|
grid-auto-columns: minmax(auto, max-content);
|
|
grid-auto-flow: column;
|
|
inset: 0 0 auto 0;
|
|
justify-content: start;
|
|
overscroll-behavior: auto;
|
|
margin-block-end: var(--block-space-half);
|
|
padding-block: var(--block-space) var(--block-space-half);
|
|
padding-inline: var(--sidebar-inline-space) calc(var(--sidebar-inline-space) + var(--column-gap));
|
|
position: sticky;
|
|
z-index: 3;
|
|
|
|
.open & {
|
|
@media (max-width: 100ch) {
|
|
-webkit-mask-image: linear-gradient(to left, oklch(0% 0 0 / 1) 85%, oklch(0% 0 0 / 0) 99%);
|
|
mask-image: linear-gradient(to left, oklch(0% 0 0 / 1) 85%, oklch(0% 0 0 / 0) 99%);
|
|
padding-inline-start: calc(var(--btn-size) + var(--sidebar-inline-space) + (var(--column-gap) * 2.5));
|
|
}
|
|
}
|
|
|
|
&.directs--new {
|
|
--column-gap: var(--inline-space);
|
|
--row-gap: 2px;
|
|
|
|
-webkit-mask-image: none;
|
|
mask-image: none;
|
|
padding-inline-end: var(--sidebar-inline-space);
|
|
}
|
|
}
|
|
|
|
.directs--edit {
|
|
display: grid;
|
|
gap: var(--inline-space);
|
|
grid-template-columns: repeat(auto-fit, minmax(33%, 1fr));
|
|
grid-template-rows: min-content;
|
|
place-items: center;
|
|
|
|
.member {
|
|
aspect-ratio: 1;
|
|
block-size: auto;
|
|
inline-size: 100%;
|
|
margin-inline: auto;
|
|
place-content: center;
|
|
}
|
|
}
|
|
|
|
.direct {
|
|
border-radius: 0.3em;
|
|
box-shadow: none;
|
|
color: var(--color-text);
|
|
display: grid;
|
|
justify-items: center;
|
|
position: relative;
|
|
text-decoration: none;
|
|
|
|
.avatar,
|
|
.avatar__group {
|
|
margin-inline: calc(var(--inline-space) / 1.5);
|
|
|
|
.avatar {
|
|
margin-inline: 0;
|
|
}
|
|
}
|
|
|
|
@media (any-hover: hover) {
|
|
&:where(:not(:active):hover) .avatar:not(.avatar--icon) {
|
|
filter: brightness(0.7);
|
|
}
|
|
}
|
|
|
|
&:focus-within,
|
|
&:where(:not(:active)):focus-visible {
|
|
outline: 0;
|
|
}
|
|
}
|
|
|
|
.direct__new {
|
|
margin-inline-end: var(--inline-space-half);
|
|
|
|
.avatar {
|
|
margin-inline: 0;
|
|
}
|
|
}
|
|
|
|
.direct__author {
|
|
--column-gap: 0.3ch;
|
|
|
|
margin-block-start: 0.1em;
|
|
|
|
.unread & {
|
|
font-weight: 800;
|
|
position: relative;
|
|
|
|
&::after {
|
|
--size: 0.6em;
|
|
|
|
aspect-ratio: 1;
|
|
background-color: var(--color-text);
|
|
block-size: var(--size);
|
|
border-radius: calc(var(--size) * 2);
|
|
content: "";
|
|
flex-shrink: 0;
|
|
inline-size: var(--size);
|
|
position: absolute;
|
|
inset: 1.3em auto auto 50%;
|
|
transform: translate(-50%);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Rooms */
|
|
.rooms {
|
|
--column-gap: 0.5em;
|
|
--row-gap: 0.5em;
|
|
|
|
padding-inline: var(--sidebar-inline-space);
|
|
}
|
|
|
|
.rooms__new-btn {
|
|
inset-block-end: calc((var(--sidebar-tools-height) * -1) + var(--block-space) * 1.5);
|
|
position: sticky;
|
|
z-index: 4;
|
|
}
|
|
|
|
.room {
|
|
background-color: var(--color-text-reversed);
|
|
color: var(--color-text);
|
|
font-weight: normal;
|
|
justify-content: start;
|
|
margin-inline-end: auto;
|
|
max-inline-size: 100%;
|
|
|
|
.searches-list & {
|
|
border-radius: 0.5em;
|
|
}
|
|
|
|
&.unread {
|
|
--btn-border-color: var(--color-text);
|
|
--hover-color: var(--color-text);
|
|
|
|
font-weight: 600;
|
|
|
|
&:not(:hover) {
|
|
box-shadow: 0 0 0 1px var(--color-text);
|
|
}
|
|
}
|
|
}
|
|
|
|
.room--current {
|
|
--btn-border-radius: 0.5em;
|
|
--hover-filter: none;
|
|
--num-buttons: 1;
|
|
|
|
min-block-size: var(--btn-size);
|
|
|
|
.room__contents {
|
|
.account-has-logo & {
|
|
--num-buttons: 2;
|
|
}
|
|
|
|
max-inline-size: calc(100dvw - (var(--btn-size) * var(--num-buttons)) - (var(--btn-size) + max(var(--inline-space), 1vw)) - ((var(--inline-space) + 1.8em) * 2) - var(--sidebar-width) - var(--inline-space) * var(--num-buttons));
|
|
|
|
@media (max-width: 100ch) {
|
|
--num-buttons: 2;
|
|
|
|
.account-has-logo & {
|
|
--num-buttons: 3;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Searches */
|
|
.searches {
|
|
#nav {
|
|
align-items: start;
|
|
column-gap: 0;
|
|
padding-inline-end: 0;
|
|
}
|
|
|
|
.rooms {
|
|
padding-block-start: var(--block-space);
|
|
}
|
|
|
|
.message--formatted .message__room {
|
|
display: block;
|
|
font-size: 0.8rem;
|
|
font-weight: 400;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
visibility: visible;
|
|
white-space: nowrap;
|
|
|
|
&::before {
|
|
content: "→";
|
|
}
|
|
|
|
.message--me & {
|
|
&::after {
|
|
content: "←";
|
|
}
|
|
|
|
&::before {
|
|
content: "";
|
|
}
|
|
}
|
|
}
|
|
|
|
.message__actions {
|
|
display: none !important;
|
|
visibility: hidden !important;
|
|
}
|
|
}
|
|
|
|
.searches__recents {
|
|
--mask: linear-gradient(to left, oklch(0% 0 0 / 1) 97%, oklch(0% 0 0 / 0) 99%);
|
|
|
|
-webkit-mask-image: var(--mask);
|
|
display: none;
|
|
mask-image: var(--mask);
|
|
position: relative;
|
|
|
|
@media (max-width: 100ch) {
|
|
display: flex;
|
|
}
|
|
|
|
.room {
|
|
max-inline-size: 20ch;
|
|
|
|
&:first-child {
|
|
margin-inline-start: var(--inline-space);
|
|
}
|
|
}
|
|
|
|
.searches__btn {
|
|
margin-inline-end: var(--inline-space-double);
|
|
}
|
|
}
|
|
|
|
.searches__query {
|
|
--btn-border-radius: 0.5em;
|
|
|
|
min-block-size: var(--btn-size);
|
|
}
|
|
|
|
.searches__results {
|
|
padding-block-start: var(--navbar-height);
|
|
}
|
|
|
|
.searches__input:required:invalid {
|
|
~ .searches__reset {
|
|
display: none;
|
|
visibility: hidden;
|
|
}
|
|
}
|