/* 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 on launch: https://github.com/vector-im/riot-web/issues/14231 // Note: the room tile expects to be in a flexbox column container .mx_RoomTile2 { margin-bottom: 4px; padding: 4px; // The tile is also a flexbox row itself display: flex; flex-wrap: wrap; &.mx_RoomTile2_selected, &:hover, &.mx_RoomTile2_hasMenuOpen { background-color: $roomtile2-selected-bg-color; border-radius: 32px; } .mx_RoomTile2_avatarContainer { margin-right: 8px; position: relative; .mx_RoomTileIcon { position: absolute; bottom: 0; right: 0; } } .mx_RoomTile2_nameContainer { flex-grow: 1; max-width: calc(100% - 58px); // 32px avatar, 18px badge area, 8px margin on avatar // 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; width: 100%; // Ellipsize any text overflow text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } .mx_RoomTile2_name { font-size: $font-14px; line-height: $font-18px; } .mx_RoomTile2_name.mx_RoomTile2_nameHasUnreadEvents { font-weight: 700; } .mx_RoomTile2_messagePreview { font-size: $font-13px; line-height: $font-18px; color: $roomtile2-preview-color; } .mx_RoomTile2_nameWithPreview { margin-top: -4px; // shift the name up a bit more } } .mx_RoomTile2_badgeContainer { width: 18px; height: 32px; // 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: center; } .mx_RoomTile2_menuButton, .mx_RoomTile2_notificationsButton { width: 20px; height: 20px; margin: auto 0 auto 8px; position: relative; display: none; &::before { top: 2px; left: 2px; content: ''; width: 16px; height: 16px; position: absolute; mask-position: center; mask-size: contain; mask-repeat: no-repeat; background: $primary-fg-color; } } .mx_RoomTile2_notificationsButton.mx_RoomTile2_notificationsButton_show { display: block; } .mx_RoomTile2_menuButton::before { mask-image: url('$(res)/img/feather-customised/more-horizontal.svg'); } &: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_notificationsButton, .mx_RoomTile2_menuButton { display: block; } } } &.mx_RoomTile2_minimized { flex-direction: column; align-items: center; position: relative; .mx_RoomTile2_avatarContainer { margin-right: 0; } .mx_RoomTile2_badgeContainer { position: absolute; top: 0; right: 0; height: 18px; } } } // We use these both in context menus and the room tiles .mx_RoomTile2_iconBell::before { mask-image: url('$(res)/img/feather-customised/bell.svg'); } .mx_RoomTile2_iconBellDot::before { mask-image: url('$(res)/img/feather-customised/bell-notification.custom.svg'); } .mx_RoomTile2_iconBellCrossed::before { mask-image: url('$(res)/img/feather-customised/bell-crossed.svg'); } .mx_RoomTile2_iconCheck::before { mask-image: url('$(res)/img/feather-customised/check.svg'); } .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_RoomTile2_contextMenu_activeRow { &.mx_AccessibleButton, .mx_AccessibleButton { color: $accent-color !important; // !important to override styles from context menu } .mx_IconizedContextMenu_icon::before { background-color: $accent-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_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'); } }