Files
ThreadNet-Web/packages/shared-components/src/room-list/RoomListItemView/RoomListItemView.module.css
T

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

107 lines
2.8 KiB
CSS
Raw Normal View History

/*
* Copyright 2025 Element Creations Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
* Please see LICENSE files in the repository root for full details.
*/
/**
* The RoomListItem has the following structure:
* button--------------------------------------------------|
* | <-12px-> container------------------------------------|
* | | room avatar <-8px-> content----------------|
* | | | room_name <- 20px ->|
* | | | --------------------| <-- border
* |-------------------------------------------------------|
*/
.roomListItem {
/* Remove button default style */
background: unset;
border: none;
padding: 0;
text-align: unset;
cursor: pointer;
height: 48px;
width: 100%;
padding-left: var(--cpd-space-3x);
font: var(--cpd-font-body-md-regular);
color: var(--cpd-color-text-primary);
/* Hide the menu by default */
.hoverMenu {
display: none;
}
}
/* Show hover menu and background on hover/focus/menu-open states */
.roomListItem:hover,
.roomListItem:focus-visible,
/* When the context menu is opened */
.roomListItem[data-state="open"],
/* When the options and notifications menu are opened */
.roomListItem:has(.hoverMenu > button[data-state="open"]) {
background-color: var(--cpd-color-bg-action-secondary-hovered);
.hoverMenu {
display: flex;
}
/* When the menu is visible, hide the notification decoration to avoid clutter */
.notificationDecoration {
display: none;
}
/**
* The figma uses 16px padding (--cpd-space-4x) but due to https://github.com/element-hq/compound-web/issues/331
* the icon size of the menu is 18px instead of 20px with a different internal padding
* We need to use 18px to align the icon with the others icons
* 18px is not available in compound spacing
*/
.content {
padding-right: 18px;
}
}
.content {
height: 100%;
flex: 1;
/* The border is only under the room name and the future hover menu */
border-bottom: var(--cpd-border-width-0-5) solid var(--cpd-color-bg-subtle-secondary);
box-sizing: border-box;
min-width: 0;
padding-right: var(--cpd-space-5x);
}
.text {
min-width: 0;
}
.roomName {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.messagePreview {
font: var(--cpd-font-body-sm-regular);
color: var(--cpd-color-text-secondary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.selected {
background-color: var(--cpd-color-bg-action-secondary-pressed);
}
.bold .roomName {
font: var(--cpd-font-body-md-semibold);
}
/* Set icon color for hover menu buttons */
.hoverMenu svg {
fill: var(--cpd-color-icon-primary);
}