2020-06-04 22:34:04 +00:00
|
|
|
/*
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
2020-06-05 20:08:20 +00:00
|
|
|
// TODO: Rename to mx_RoomTile during replacement of old component
|
|
|
|
|
2020-06-05 03:21:04 +00:00
|
|
|
// Note: the room tile expects to be in a flexbox column container
|
2020-06-04 22:34:04 +00:00
|
|
|
.mx_RoomTile2 {
|
2020-06-05 20:08:20 +00:00
|
|
|
margin-bottom: 4px;
|
|
|
|
padding: 4px;
|
2020-06-05 03:21:04 +00:00
|
|
|
|
|
|
|
// The tile is also a flexbox row itself
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
2020-06-10 05:09:15 +00:00
|
|
|
&.mx_RoomTile2_selected, &:hover, &.mx_RoomTile2_hasMenuOpen {
|
2020-06-05 20:08:20 +00:00
|
|
|
background-color: $roomtile2-selected-bg-color;
|
|
|
|
border-radius: 32px;
|
|
|
|
}
|
|
|
|
|
2020-06-05 03:21:04 +00:00
|
|
|
.mx_RoomTile2_avatarContainer {
|
|
|
|
margin-right: 8px;
|
2020-06-16 18:13:12 +00:00
|
|
|
position: relative;
|
|
|
|
|
2020-06-16 20:43:48 +00:00
|
|
|
.mx_RoomTileIcon {
|
2020-06-16 18:13:12 +00:00
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
right: 0;
|
|
|
|
}
|
2020-06-05 03:21:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomTile2_nameContainer {
|
2020-06-10 05:09:15 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
max-width: calc(100% - 58px); // 32px avatar, 18px badge area, 8px margin on avatar
|
|
|
|
|
2020-06-05 03:21:04 +00:00
|
|
|
// Create a new column layout flexbox for the name parts
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
.mx_RoomTile2_name,
|
|
|
|
.mx_RoomTile2_messagePreview {
|
|
|
|
margin: 0 2px;
|
2020-06-10 05:09:15 +00:00
|
|
|
width: 100%;
|
2020-06-05 03:21:04 +00:00
|
|
|
|
2020-06-10 05:09:15 +00:00
|
|
|
// Ellipsize any text overflow
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
2020-06-05 03:21:04 +00:00
|
|
|
|
|
|
|
.mx_RoomTile2_name {
|
|
|
|
font-size: $font-14px;
|
2020-06-10 03:12:49 +00:00
|
|
|
line-height: $font-18px;
|
2020-06-05 03:21:04 +00:00
|
|
|
}
|
|
|
|
|
2020-06-08 19:42:18 +00:00
|
|
|
.mx_RoomTile2_name.mx_RoomTile2_nameHasUnreadEvents {
|
2020-06-19 21:43:05 +00:00
|
|
|
font-weight: 700;
|
2020-06-08 19:42:18 +00:00
|
|
|
}
|
|
|
|
|
2020-06-05 03:21:04 +00:00
|
|
|
.mx_RoomTile2_messagePreview {
|
|
|
|
font-size: $font-13px;
|
|
|
|
line-height: $font-18px;
|
|
|
|
color: $roomtile2-preview-color;
|
|
|
|
}
|
2020-06-10 03:12:49 +00:00
|
|
|
|
|
|
|
.mx_RoomTile2_nameWithPreview {
|
|
|
|
margin-top: -4px; // shift the name up a bit more
|
|
|
|
}
|
2020-06-05 03:21:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomTile2_badgeContainer {
|
2020-06-10 05:09:15 +00:00
|
|
|
width: 18px;
|
|
|
|
height: 32px;
|
2020-06-05 03:21:04 +00:00
|
|
|
|
|
|
|
// Create another flexbox row because it's super easy to position the badge at
|
|
|
|
// the end this way.
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2020-06-10 21:05:17 +00:00
|
|
|
justify-content: center;
|
2020-06-05 03:21:04 +00:00
|
|
|
}
|
2020-06-10 05:09:15 +00:00
|
|
|
|
|
|
|
// The menu button is hidden by default
|
2020-06-10 05:13:57 +00:00
|
|
|
// TODO: [Notifications] Use mx_RoomTile2_notificationsButton, similar to the following approach:
|
2020-06-10 05:09:15 +00:00
|
|
|
// https://github.com/matrix-org/matrix-react-sdk/blob/2180a56074f3698fc0241c309a72ba6cad802d1c/res/css/views/rooms/_RoomSublist2.scss#L48-L76
|
|
|
|
// You'll need to do the same down below on the &:hover selector for the tile.
|
|
|
|
// ... also remove this 4 line TODO comment.
|
2020-06-10 05:13:57 +00:00
|
|
|
.mx_RoomTile2_menuButton,
|
|
|
|
.mx_RoomTile2_notificationsButton {
|
2020-06-10 05:09:15 +00:00
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
visibility: hidden;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
content: '';
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
position: absolute;
|
|
|
|
mask-position: center;
|
|
|
|
mask-size: contain;
|
|
|
|
mask-repeat: no-repeat;
|
|
|
|
background: $primary-fg-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomTile2_menuButton::before {
|
|
|
|
top: 8px;
|
|
|
|
left: -1px; // this is off-center to align it with the badges
|
|
|
|
mask-image: url('$(res)/img/feather-customised/more-horizontal.svg');
|
|
|
|
}
|
|
|
|
|
2020-06-11 20:39:28 +00:00
|
|
|
&:not(.mx_RoomTile2_minimized) {
|
|
|
|
&:hover, &.mx_RoomTile2_hasMenuOpen {
|
|
|
|
// Hide the badge container on hover because it'll be a menu button
|
|
|
|
.mx_RoomTile2_badgeContainer {
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomTile2_menuButton {
|
|
|
|
width: 18px;
|
|
|
|
height: 32px;
|
|
|
|
visibility: visible;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.mx_RoomTile2_minimized {
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
.mx_RoomTile2_avatarContainer {
|
|
|
|
margin-right: 0;
|
2020-06-10 05:09:15 +00:00
|
|
|
}
|
|
|
|
|
2020-06-11 20:39:28 +00:00
|
|
|
.mx_RoomTile2_badgeContainer {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 0;
|
|
|
|
height: 18px;
|
2020-06-10 05:09:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomTile2_contextMenu {
|
|
|
|
.mx_RoomTile2_contextMenu_redRow {
|
|
|
|
.mx_AccessibleButton {
|
|
|
|
color: $warning-color !important; // !important to override styles from context menu
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_IconizedContextMenu_icon::before {
|
|
|
|
background-color: $warning-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_IconizedContextMenu_icon {
|
|
|
|
position: relative;
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
content: '';
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
position: absolute;
|
|
|
|
mask-position: center;
|
|
|
|
mask-size: contain;
|
|
|
|
mask-repeat: no-repeat;
|
|
|
|
background: $primary-fg-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomTile2_iconStar::before {
|
|
|
|
mask-image: url('$(res)/img/feather-customised/star.svg');
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomTile2_iconArrowDown::before {
|
|
|
|
mask-image: url('$(res)/img/feather-customised/arrow-down.svg');
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomTile2_iconUser::before {
|
|
|
|
mask-image: url('$(res)/img/feather-customised/user.svg');
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomTile2_iconSettings::before {
|
|
|
|
mask-image: url('$(res)/img/feather-customised/settings.svg');
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_RoomTile2_iconSignOut::before {
|
|
|
|
mask-image: url('$(res)/img/feather-customised/sign-out.svg');
|
|
|
|
}
|
2020-06-04 22:34:04 +00:00
|
|
|
}
|