mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 20:25:33 +08:00
5ce0697348
Before this commit chat was applying a fixed height on everything under the `/chat` route. It's only really needed on the channel page with the composer at the bottom of the page. This commits makes the following changes: - moves height limitation from `#main-outlet-wrapper` to `.chat-channel` - makes browse channel page and members list page full height and rely on main document scrollbar - adds height computation for draft header and direct message creator block to ensure the height is correct when creating a draft channel - makes chat index full height to rely on the browser scrollbar. As a result the <kbd> + </kbd> button used on mobile to create a direct message as been moved out of `<ChannelsList>` into the chat index template - sidebar height was relying on chat setting a max height, as a result the height computation of sidebar has been changed to work correctly, especially with an opened keyboard on mobile or ipad
243 lines
4.7 KiB
SCSS
243 lines
4.7 KiB
SCSS
.btn-floating.open-draft-channel-page-btn {
|
|
position: fixed;
|
|
background: var(--tertiary);
|
|
bottom: 2rem;
|
|
right: 2rem;
|
|
border-radius: 50%;
|
|
font-size: var(--font-up-4);
|
|
padding: 1rem;
|
|
transition: transform 0.25s ease, box-shadow 0.25s ease;
|
|
z-index: z("usercard");
|
|
box-shadow: 0px 5px 5px -1px rgba(0, 0, 0, 0.25);
|
|
|
|
.d-icon {
|
|
color: var(--primary-very-low);
|
|
}
|
|
|
|
&:active {
|
|
box-shadow: 0px 0px 5px -1px rgba(0, 0, 0, 0.25);
|
|
transform: scale(0.9);
|
|
}
|
|
|
|
&:focus {
|
|
@include default-focus;
|
|
border-color: var(--quaternary);
|
|
outline-color: var(--quaternary);
|
|
}
|
|
}
|
|
|
|
.channels-list {
|
|
overflow-y: auto;
|
|
overscroll-behavior: contain;
|
|
height: 100%;
|
|
padding-bottom: env(safe-area-inset-bottom);
|
|
position: relative;
|
|
@include chat-scrollbar();
|
|
|
|
@include breakpoint(mobile-large) {
|
|
@include chat-scrollbar();
|
|
}
|
|
|
|
.open-browse-page-btn,
|
|
.open-draft-channel-page-btn,
|
|
.chat-channel-leave-btn {
|
|
position: relative;
|
|
padding: 0;
|
|
background: transparent;
|
|
color: var(--primary-medium);
|
|
font-size: var(--font-0-rem);
|
|
|
|
&:after {
|
|
content: "";
|
|
position: absolute;
|
|
top: -50%;
|
|
left: -50%;
|
|
width: 200%;
|
|
height: 200%;
|
|
}
|
|
|
|
&:hover {
|
|
background: transparent;
|
|
|
|
.d-icon {
|
|
color: var(--primary);
|
|
}
|
|
}
|
|
}
|
|
|
|
.public-channel-empty-message {
|
|
margin: 0 0.5em 0.5em 0.5em;
|
|
padding: 0 1em;
|
|
}
|
|
|
|
.chat-channel-divider {
|
|
padding: 2.5rem 1.5rem 0.5rem 1.5rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
font-weight: bold;
|
|
font-family: var(--heading-font-family);
|
|
font-size: var(--font-down-1);
|
|
color: var(--quaternary);
|
|
|
|
.channel-title {
|
|
line-height: var(--line-height-medium);
|
|
}
|
|
|
|
&:first-of-type {
|
|
padding-top: 1rem;
|
|
}
|
|
}
|
|
|
|
.chat-channel-row {
|
|
align-items: center;
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
position: relative;
|
|
cursor: pointer;
|
|
color: var(--primary-high);
|
|
|
|
@media (hover: none) {
|
|
&:hover,
|
|
&:focus {
|
|
background: transparent;
|
|
}
|
|
|
|
&:active {
|
|
background: var(--primary-low);
|
|
}
|
|
}
|
|
|
|
@media (hover: hover) {
|
|
&:hover,
|
|
&.active {
|
|
background: var(--primary-very-low);
|
|
}
|
|
|
|
&.can-leave:hover {
|
|
.toggle-channel-membership-button.-leave {
|
|
display: block;
|
|
|
|
> * {
|
|
pointer-events: auto;
|
|
}
|
|
}
|
|
|
|
.chat-channel-metadata {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
&:hover,
|
|
&.active {
|
|
.chat-channel-title {
|
|
&,
|
|
.category-chat-name,
|
|
.dm-usernames {
|
|
color: var(--primary);
|
|
}
|
|
|
|
.d-icon-lock {
|
|
background-color: var(--primary-low);
|
|
}
|
|
}
|
|
}
|
|
|
|
&:visited {
|
|
color: var(--primary-high);
|
|
}
|
|
|
|
&.muted {
|
|
opacity: 0.65;
|
|
}
|
|
|
|
.chat-channel-title {
|
|
&__users-count {
|
|
width: var(--channel-list-avatar-size);
|
|
height: var(--channel-list-avatar-size);
|
|
padding: 0;
|
|
font-size: var(--font-up-1);
|
|
justify-content: center;
|
|
}
|
|
|
|
&__avatar {
|
|
.chat-user-avatar {
|
|
img {
|
|
width: calc(var(--channel-list-avatar-size) - 2px);
|
|
height: calc(var(--channel-list-avatar-size) - 2px);
|
|
}
|
|
}
|
|
}
|
|
&__user-info {
|
|
@include ellipsis;
|
|
}
|
|
&__usernames {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: start;
|
|
}
|
|
.user-status-message {
|
|
display: inline-block;
|
|
font-size: var(--font-down-2);
|
|
margin-right: 0.5rem;
|
|
|
|
&-description {
|
|
color: var(--primary-medium);
|
|
}
|
|
}
|
|
}
|
|
|
|
.chat-channel-metadata {
|
|
display: flex;
|
|
align-items: flex-end;
|
|
flex-direction: column;
|
|
margin-left: 0.5em;
|
|
|
|
&__date {
|
|
color: var(--primary-high);
|
|
font-size: var(--font-down-2);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.chat-channel-unread-indicator {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: auto;
|
|
min-width: 14px;
|
|
padding: 2px;
|
|
font-size: var(--font-down-3);
|
|
border-radius: 1em;
|
|
background: var(--tertiary-med-or-tertiary);
|
|
|
|
&.urgent {
|
|
background: var(--success);
|
|
}
|
|
|
|
.number {
|
|
line-height: 1rem;
|
|
}
|
|
}
|
|
}
|
|
|
|
&.unfollowing {
|
|
opacity: 0;
|
|
}
|
|
|
|
.toggle-channel-membership-button.-leave {
|
|
display: none;
|
|
margin-left: auto;
|
|
}
|
|
.badge-wrapper {
|
|
align-items: center;
|
|
margin-right: 0;
|
|
}
|
|
|
|
.emoji {
|
|
margin-left: 0.3em;
|
|
}
|
|
}
|
|
}
|