mirror of https://github.com/vector-im/riot-web
183 lines
5.3 KiB
SCSS
183 lines
5.3 KiB
SCSS
/*
|
|
Copyright 2020 The Matrix.org Foundation C.I.C.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
// TODO: Rename to mx_RoomSublist during replacement of old component
|
|
|
|
// TODO: Just use the 3 selectors we need from this instead of importing it.
|
|
// We're going to end up with heavy modifications anyways.
|
|
@import "../../../../node_modules/react-resizable/css/styles.css";
|
|
|
|
.mx_RoomSublist2 {
|
|
// The sublist is a column of rows, essentially
|
|
display: flex;
|
|
flex-direction: column;
|
|
|
|
margin-left: 8px;
|
|
margin-top: 12px;
|
|
margin-bottom: 12px;
|
|
|
|
.mx_RoomSublist2_headerContainer {
|
|
// Create a flexbox to make ordering easy
|
|
display: flex;
|
|
align-items: center;
|
|
|
|
.mx_RoomSublist2_badgeContainer {
|
|
opacity: 0.8;
|
|
padding-right: 7px;
|
|
|
|
// Create another flexbox row because it's super easy to position the badge at
|
|
// the end this way.
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
// Both of these buttons are hidden by default until the list is hovered
|
|
.mx_RoomSublist2_auxButton,
|
|
.mx_RoomSublist2_menuButton {
|
|
width: 0;
|
|
margin: 0;
|
|
visibility: hidden;
|
|
position: relative;
|
|
|
|
&::before {
|
|
content: '';
|
|
width: 16px;
|
|
height: 16px;
|
|
position: absolute;
|
|
top: 4px;
|
|
left: 4px;
|
|
mask-position: center;
|
|
mask-size: contain;
|
|
mask-repeat: no-repeat;
|
|
background: $muted-fg-color;
|
|
}
|
|
}
|
|
|
|
.mx_RoomSublist2_auxButton::before {
|
|
mask-image: url('$(res)/img/feather-customised/plus.svg');
|
|
}
|
|
|
|
.mx_RoomSublist2_menuButton::before {
|
|
mask-image: url('$(res)/img/feather-customised/more-horizontal.svg');
|
|
}
|
|
|
|
.mx_RoomSublist2_headerText {
|
|
text-transform: uppercase;
|
|
opacity: 0.5;
|
|
line-height: $font-16px;
|
|
font-size: $font-12px;
|
|
padding-bottom: 8px;
|
|
|
|
width: 100%;
|
|
flex: 1;
|
|
|
|
// Ellipsize any text overflow
|
|
text-overflow: ellipsis;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
|
|
.mx_RoomSublist2_resizeBox {
|
|
// Create another flexbox column for the tiles
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
|
|
.mx_RoomSublist2_showMoreButton {
|
|
height: 44px; // 1 room tile high
|
|
cursor: pointer;
|
|
|
|
// We create a flexbox to cheat at alignment
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
}
|
|
|
|
&:hover, &.mx_RoomSublist2_hasMenuOpen {
|
|
.mx_RoomSublist2_headerContainer {
|
|
// If the header doesn't have an aux button we still need to hide the badge for
|
|
// the menu button.
|
|
.mx_RoomSublist2_badgeContainer {
|
|
// Completely hide the badge
|
|
width: 0;
|
|
margin: 0;
|
|
visibility: hidden;
|
|
}
|
|
|
|
&:not(.mx_RoomSublist2_headerContainer_withAux) {
|
|
// The menu button will be the rightmost button, so make it correctly aligned.
|
|
.mx_RoomSublist2_menuButton {
|
|
margin-right: 16px;
|
|
}
|
|
}
|
|
|
|
// Both of these buttons have circled backgrounds and are visible at this point,
|
|
// so make them so.
|
|
.mx_RoomSublist2_auxButton,
|
|
.mx_RoomSublist2_menuButton {
|
|
width: 24px;
|
|
height: 24px;
|
|
border-radius: 32px;
|
|
margin-left: 16px;
|
|
background-color: #fff; // TODO: Variable and theme
|
|
visibility: visible;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// We have a hover style on the room list with no specific list hovered, so account for that
|
|
.mx_RoomList2:hover .mx_RoomSublist2,
|
|
.mx_RoomSublist2_hasMenuOpen {
|
|
.mx_RoomSublist2_headerContainer_withAux {
|
|
.mx_RoomSublist2_badgeContainer {
|
|
// Completely hide the badge
|
|
width: 0;
|
|
margin: 0;
|
|
visibility: hidden;
|
|
}
|
|
|
|
.mx_RoomSublist2_auxButton {
|
|
// Show the aux button, but not the list button
|
|
width: 24px;
|
|
height: 24px;
|
|
margin-right: 16px;
|
|
visibility: visible;
|
|
}
|
|
}
|
|
}
|
|
|
|
.mx_RoomSublist2_contextMenu {
|
|
padding: 20px 16px;
|
|
width: 250px;
|
|
|
|
hr {
|
|
margin-top: 16px;
|
|
margin-bottom: 16px;
|
|
margin-right: 16px; // additional 16px
|
|
border: 1px solid $roomsublist2-divider-color;
|
|
}
|
|
|
|
.mx_RoomSublist2_contextMenu_title {
|
|
font-size: $font-15px;
|
|
line-height: $font-20px;
|
|
font-weight: 600;
|
|
margin-bottom: 12px;
|
|
}
|
|
}
|