1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-11-16 16:30:09 +00:00
Tims-Chat/files/style/be.bastelstu.chat.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

756 lines
13 KiB
SCSS
Raw Normal View History

2018-08-16 22:30:59 +00:00
/*
* Copyright (c) 2010-2022 Tim Düsterhus.
2018-08-16 22:30:59 +00:00
*
* Use of this software is governed by the Business Source License
* included in the LICENSE file.
*
2023-02-22 16:45:50 +00:00
* Change Date: 2027-02-22
2018-08-16 22:30:59 +00:00
*
* On the date above, in accordance with the Business Source
* License, use of this software will be governed by version 2
* or later of the General Public License.
*/
$chatEmbedMaxWidth: 400px;
#tpl_chat_room #chatMessageStream {
margin-top: 0;
}
#tpl_chat_room,
#tpl_chat_log {
@include screen-md-down {
.main > .layoutBoundary {
display: flex;
flex-direction: column;
flex: 1 1 auto;
}
.sidebar {
display: none;
}
}
// Enable WSC 3.1 sidebar toggle on smartphones
@include screen-xs {
.sidebar {
&[data-show-sidebar][data-hide-sidebar] {
display: block;
flex: 0 0 auto;
}
}
.boxesSidebarLeft,
.boxesSidebarRight {
.box .boxMenu {
.boxMenuLink,
.boxMenuLinkTitle {
white-space: pre-wrap;
}
}
}
}
@include screen-sm-md {
.main > .layoutBoundary {
flex-direction: row !important;
}
#content {
margin-left: 20px;
2018-08-16 22:30:59 +00:00
width: auto !important;
}
#chatMessageStream {
margin-right: 10px;
}
.sidebar.boxesSidebarRight {
display: flex;
flex: 0.5 0 auto;
flex-direction: column;
margin-left: 10px;
2022-08-10 00:11:30 +00:00
max-width: min(310px, 35%);
2018-08-16 22:30:59 +00:00
> .boxContainer {
-webkit-columns: 1;
-moz-columns: 1;
columns: 1;
2022-08-10 00:11:30 +00:00
margin-bottom: 0;
> .box {
border-bottom: none;
}
2018-08-16 22:30:59 +00:00
}
}
}
2022-08-10 00:11:30 +00:00
@include screen-sm-up {
.layoutBoundary {
flex-wrap: nowrap;
}
.content + .sidebar.boxesSidebarRight {
margin-top: 0;
}
2018-08-16 22:30:59 +00:00
.boxesSidebarRight {
&,
> .boxContainer {
display: flex;
flex-direction: column;
}
> .boxContainer {
overflow: auto;
2018-08-22 22:07:37 +00:00
flex: 1 1 auto;
2018-08-16 22:30:59 +00:00
> .box {
&.chatUserList {
flex: 2 0 0px;
2018-08-16 22:30:59 +00:00
min-height: 15rem;
html.fullscreen & {
flex: 1 1 content;
}
2018-08-16 22:30:59 +00:00
> .boxContent {
flex-basis: 6rem;
}
}
2021-08-15 10:58:50 +00:00
&[data-box-identifier='be.bastelstu.chat.roomListSidebar'] {
flex: 1 1 12rem;
2018-08-16 22:30:59 +00:00
min-height: 12rem;
html.fullscreen & {
flex: 1 1 content;
}
@media screen and (max-height: 440px) {
min-height: 120px;
}
2018-08-16 22:30:59 +00:00
.badge {
float: right;
padding-left: 7px;
}
> .boxContent {
height: 6rem;
}
}
&.chatUserList,
2021-08-15 10:58:50 +00:00
&[data-box-identifier='be.bastelstu.chat.roomListSidebar'] {
2018-08-16 22:30:59 +00:00
display: flex;
flex-direction: column;
> .boxContent {
overflow-y: auto;
flex: 1 1 auto;
}
}
}
}
}
2022-08-10 00:11:30 +00:00
}
2018-08-16 22:30:59 +00:00
2022-08-10 00:11:30 +00:00
@include screen-lg {
2018-08-16 22:30:59 +00:00
#chatQuickSettings {
display: none;
}
}
.main {
display: flex;
> .layoutBoundary {
flex: 1 1 auto;
}
}
.chatRoomTopic {
border-left: 5px solid $wcfContentBorderInner;
padding: 5px 0px 5px 10px;
margin-bottom: 10px;
.jsDismissRoomTopicButton {
float: right;
}
}
#content {
display: flex;
flex-direction: column;
flex: 1 1 auto;
width: 100%;
> .contentInteraction:first-child {
margin-top: 0;
margin-bottom: 20px;
}
2018-08-16 22:30:59 +00:00
}
#chatMessageStream > .scrollContainer,
#chatUserList > .boxContent,
2021-08-15 10:58:50 +00:00
[data-box-identifier='be.bastelstu.chat.roomListSidebar'] > .boxContent {
2018-08-16 22:30:59 +00:00
position: relative;
overflow-y: scroll;
padding-right: 5px;
}
2021-08-15 10:58:50 +00:00
[data-box-identifier='be.bastelstu.chat.roomListSidebar'] > .boxContent {
2018-08-16 22:30:59 +00:00
overflow-x: hidden;
// Fixes issues with backgrounds being cut by the overflow-x
margin-left: -20px;
> div > .boxMenu {
margin-left: 0;
}
}
#chatUserList {
li.box24 {
> :nth-child(2) {
flex: 1 1 auto;
overflow: hidden;
}
> :last-child.iconColumn {
flex: 0 1 auto;
}
}
}
#chatMessageStream {
display: flex;
flex: 1 1 auto;
flex-direction: column;
&:not(.activity) .activityInfo {
@extend .invisible;
}
> .infoMessages {
position: relative;
> * {
margin-top: 0;
margin-bottom: 20px;
}
}
> .scrollContainer {
display: flex;
flex: 1 1 15em;
flex-direction: column;
> ul {
> li {
&.dateMarker {
text-align: center;
@include wcfFontBold;
}
&:target {
2021-08-15 10:58:50 +00:00
background-color: rgba(
255,
255,
102,
0.4
); // .codeBoxJumpAnchor:target::after
2018-08-16 22:30:59 +00:00
}
&.readMarker {
border-bottom: 2px dashed rgba(204, 0, 0, 1); // .badge.red
margin-bottom: 0px !important;
& + .first {
border-top: none;
}
}
&:first-child.first {
border-top: none;
}
.chatMessageContainer {
display: flex;
margin-top: 3px;
margin-bottom: 3px;
position: relative;
// Allows to easily add a marker for special messages like mentions
border-left: 3px solid transparent;
.chatMessageContent {
flex: 1 1 auto;
// Limit embedded images and videos to a reasonable size
img:not(.smiley):not(.userAvatarImage) {
// Workaround: `min` is an internal Sass function but we want the actual CSS function
max-width: min + unquote( '(' ) + "#{100%, $chatEmbedMaxWidth}" + unquote( ')' );
2018-08-16 22:30:59 +00:00
}
.videoContainer {
@media screen and (min-width: $chatEmbedMaxWidth) {
padding-bottom: ($chatEmbedMaxWidth / 16 * 9);
}
> iframe {
max-width: $chatEmbedMaxWidth;
max-height: ($chatEmbedMaxWidth / 16 * 9);
}
}
}
.chatMessageIcon {
float: left;
margin-right: 5px;
}
&,
&.inline {
.chatMessageSide > .chatUserAvatar,
.chatMessageContent > .chatMessageHeader {
display: none;
}
}
.chatMessageSide {
min-width: 58px;
display: flex;
flex: 0 0 auto;
flex-direction: column;
align-items: center;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
> time {
@extend .small;
display: none;
}
}
.chatMessageHeader {
.username {
font-weight: bold;
}
}
}
&.first,
&:hover {
.chatMessageSide > time {
display: inline-block;
}
}
&.first {
border-top: 1px solid $wcfContentBorderInner;
.chatMessageContainer {
.chatMessageSide {
> .chatUserAvatar {
margin-top: 3px;
display: block;
}
> time {
display: none;
}
}
.chatMessageContent {
> .chatMessageHeader {
display: block;
}
}
&.inline {
.chatMessageSide {
> .chatUserAvatar {
display: none;
}
> time {
display: inline-block;
}
}
.chatMessageContent {
> .chatMessageHeader {
display: none;
}
}
}
}
}
.buttonList {
display: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
}
}
}
}
#chatInputContainer {
margin-top: 10px;
margin-bottom: 1.48 * $wcfFontSizeDefault; // 1.48 is the default line height
2018-08-16 22:30:59 +00:00
clear: both;
.charCounter {
float: right;
color: $wcfContentDimmedText;
margin-bottom: -(1.48 * $wcfFontSizeDefault);
}
textarea {
resize: none;
2018-08-16 22:30:59 +00:00
}
> div {
display: flex;
> div.chatAttachButton {
flex-grow: 0;
flex-shrink: 0;
margin-right: 5px;
@include screen-xs {
> .disabled {
display: none;
}
}
.icon16 {
display: none;
}
@include screen-lg {
.icon16 {
display: inline-block;
}
.icon24 {
display: none;
}
}
2018-08-16 22:30:59 +00:00
}
> div.chatInputWrapper {
flex-grow: 1;
display: flex;
align-items: center;
> .flexibleTextarea {
flex: 1 0 auto;
max-width: 100%;
}
> #chatQuickSettings {
flex: 0 0 auto;
}
2018-08-16 22:30:59 +00:00
}
}
.innerError {
float: left;
}
}
#chatQuickSettingsNavigation {
@extend .buttonGroupNavigation;
position: relative;
> .buttonGroup {
@include screen-lg {
justify-content: flex-end;
> li > .button {
@extend .small;
}
}
@include screen-md-down {
@include dropdownMenu;
@at-root (with: all) {
html[data-color-scheme="dark"] & {
border: 1px solid var(--wcfDropdownBorderInner);
}
}
2018-08-16 22:30:59 +00:00
&.open {
display: block;
visibility: visible;
position: absolute;
right: 24px !important;
bottom: 0;
> li {
margin-right: 0;
}
// these rules are required to work around the .button default styling
.button {
@include wcfFontDefault;
text-align: start;
2018-08-16 22:30:59 +00:00
&.active,
&.active:hover {
color: $wcfButtonTextActive !important;
}
&:not(.active) {
background-color: transparent;
color: $wcfDropdownLink;
}
border-radius: 0;
}
}
}
}
}
.smiliesToggleMobileButton {
margin-right: 5px;
}
#chatQuickSettings {
margin-left: 5px;
}
#chatUserList,
[data-box-identifier='be.bastelstu.chat.roomListSidebar'] {
.modalCloseButton {
margin: 0 -10px -20px -10px;
2018-08-16 22:30:59 +00:00
}
}
2018-08-16 22:30:59 +00:00
@include screen-md-down {
#smileyPickerContainer[data-show='true'] > div {
margin: 0;
2018-08-16 22:30:59 +00:00
}
#smileyPickerContainer,
#chatUserList,
[data-box-identifier='be.bastelstu.chat.roomListSidebar'] {
2021-08-15 10:58:50 +00:00
&[data-show='true'] {
2018-08-16 22:30:59 +00:00
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 9001;
display: flex;
flex-direction: column;
pointer-events: all;
background-color: $wcfContentBackground;
.modalCloseButton {
border-top: 1px solid $wcfContentBorderInner;
2018-08-16 22:30:59 +00:00
background-color: $wcfSidebarBackground;
color: $wcfSidebarLink;
display: block;
padding: 10px 20px;
text-align: center;
flex: 0 0 auto;
cursor: pointer;
}
> div {
border: none;
2018-08-16 22:30:59 +00:00
height: 0;
flex: 1 1 auto;
position: relative;
display: flex;
flex-direction: column;
> nav > ul {
margin-bottom: -5px;
> li {
margin-right: 10px;
margin-bottom: 5px;
border-right: 1px solid $wcfContentBorderInner;
padding-right: 9px;
> a {
font-size: 15px;
}
}
}
.messageTabMenuContent {
overflow: auto;
flex: 1 1 auto;
}
}
}
}
}
#smileyPickerContainer {
> .messageTabMenuContent {
background-color: $wcfContentContainerBackground;
border: 1px solid $wcfContentBorderInner;
padding: 20px;
margin-top: 20px;
margin-bottom: 20px;
> .smileyList {
overflow: auto;
}
}
.modalCloseButton {
display: none;
}
}
#chatAttachmentUploadDialog {
.attachmentPreview {
text-align: center;
2020-11-02 20:27:08 +00:00
.error {
margin-top: 0;
margin-bottom: 20px;
}
img {
margin-left: auto !important;
margin-right: auto !important;
}
.buttonGroup {
justify-content: center;
}
}
}
2018-08-16 22:30:59 +00:00
}
html.fullscreen {
#tpl_chat_room,
#tpl_chat_log {
// Some styles might limit the pageContainers width and height,
// we remove margins and paddings here as it shouldnt cause problems
// in most styles but might fix more.
.pageContainer {
margin: 0;
padding: 0;
max-height: 100%;
max-width: 100%;
width: 100%;
}
2018-08-16 22:30:59 +00:00
.pageHeaderContainer,
.pageNavigation,
.boxesFooterBoxes,
.pageFooter,
.contentInteraction {
2018-08-16 22:30:59 +00:00
display: none;
}
.main {
@include screen-sm-up {
height: 100vh;
2018-08-16 22:30:59 +00:00
}
padding: 14px 0;
.layoutBoundary {
max-width: none;
width: auto;
}
}
#chatMessageStream {
> .scrollContainer {
2021-08-15 10:58:50 +00:00
// flex: 1 1 0; // Disable min height in fullscreen mode
2018-08-16 22:30:59 +00:00
}
}
2018-08-22 22:07:37 +00:00
@include screen-sm-up {
.sidebar {
overflow-y: auto;
}
}
2018-08-16 22:30:59 +00:00
// The to top button is clickable even when invisible and may lay over the chat input
// This button is unnecessary in the chat, therefore we hide it completely.
// If necessary, we should change the selector to .toTop[aria-hidden="true"].
.pageAction > .toTop {
display: none;
pointer-events: none;
}
}
}
html:not(.mobile) {
#tpl_chat_room,
#tpl_chat_log {
#chatMessageStream {
.chatMessageContainer {
.buttonList {
position: absolute;
bottom: -1px;
right: 0px;
.button {
padding: 4px 6px;
}
}
&:hover {
> .buttonList {
display: flex;
}
}
}
}
}
}
// based on https://github.com/alexdunphy/flexText
.flexibleTextarea {
position: relative;
> .flexibleTextareaContent,
> .flexibleTextareaMirror {
max-height: 200px;
overflow: auto;
}
> .flexibleTextareaContent {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
resize: none;
}
> .flexibleTextareaMirror {
display: block;
visibility: hidden;
@extend textarea;
}
}