2020-08-04 20:42:39 +00:00
|
|
|
/*
|
2024-09-09 13:57:16 +00:00
|
|
|
Copyright 2024 New Vector Ltd.
|
|
|
|
Copyright 2020-2023 The Matrix.org Foundation C.I.C.
|
2020-08-04 20:42:39 +00:00
|
|
|
|
2024-09-09 13:57:16 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
|
|
|
|
Please see LICENSE files in the repository root for full details.
|
2020-08-04 20:42:39 +00:00
|
|
|
*/
|
|
|
|
|
2022-07-27 13:39:29 +00:00
|
|
|
/* A context menu that largely fits the | [icon] [label] | format. */
|
2020-08-04 20:42:39 +00:00
|
|
|
.mx_IconizedContextMenu {
|
|
|
|
min-width: 146px;
|
2021-11-15 11:39:25 +00:00
|
|
|
width: max-content;
|
2024-01-02 18:56:39 +00:00
|
|
|
/* override default ul styles */
|
2023-05-15 13:33:49 +00:00
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
2020-08-04 20:42:39 +00:00
|
|
|
|
|
|
|
.mx_IconizedContextMenu_optionList {
|
|
|
|
& > * {
|
|
|
|
padding-left: 20px;
|
|
|
|
padding-right: 20px;
|
|
|
|
}
|
|
|
|
|
2022-05-04 14:41:56 +00:00
|
|
|
.mx_IconizedContextMenu_optionList_label {
|
|
|
|
font-size: $font-15px;
|
2023-06-29 10:30:25 +00:00
|
|
|
font-weight: var(--cpd-font-weight-semibold);
|
2022-05-04 14:41:56 +00:00
|
|
|
}
|
|
|
|
|
2022-07-27 13:39:29 +00:00
|
|
|
/* the notFirst class is for cases where the optionList might be under a header of sorts. */
|
2022-12-12 11:24:14 +00:00
|
|
|
&:nth-child(n + 2),
|
|
|
|
.mx_IconizedContextMenu_optionList_notFirst {
|
2024-03-13 13:38:32 +00:00
|
|
|
border-top: var(--cpd-border-width-1) solid var(--cpd-color-gray-400);
|
2020-08-04 20:42:39 +00:00
|
|
|
}
|
|
|
|
|
2022-07-27 13:39:29 +00:00
|
|
|
/* round the top corners of the top button for the hover effect to be bounded */
|
2022-02-01 17:23:21 +00:00
|
|
|
&:first-child .mx_IconizedContextMenu_item:first-child {
|
2022-07-27 13:39:29 +00:00
|
|
|
border-radius: 8px 8px 0 0; /* radius matches .mx_ContextualMenu */
|
2020-08-04 20:42:39 +00:00
|
|
|
}
|
|
|
|
|
2022-07-27 13:39:29 +00:00
|
|
|
/* round the bottom corners of the bottom button for the hover effect to be bounded */
|
2022-02-01 17:23:21 +00:00
|
|
|
&:last-child .mx_IconizedContextMenu_item:last-child {
|
2022-07-27 13:39:29 +00:00
|
|
|
border-radius: 0 0 8px 8px; /* radius matches .mx_ContextualMenu */
|
2020-08-04 20:42:39 +00:00
|
|
|
}
|
|
|
|
|
2022-07-27 13:39:29 +00:00
|
|
|
/* round all corners of the only button for the hover effect to be bounded */
|
2022-02-01 17:23:21 +00:00
|
|
|
&:first-child:last-child .mx_IconizedContextMenu_item:first-child:last-child {
|
2022-07-27 13:39:29 +00:00
|
|
|
border-radius: 8px; /* radius matches .mx_ContextualMenu */
|
2021-11-30 18:08:46 +00:00
|
|
|
}
|
|
|
|
|
2022-02-01 17:23:21 +00:00
|
|
|
.mx_IconizedContextMenu_item {
|
2022-07-27 13:39:29 +00:00
|
|
|
/* pad the inside of the button so that the hover background is padded too */
|
2020-08-04 20:42:39 +00:00
|
|
|
padding-top: 12px;
|
|
|
|
padding-bottom: 12px;
|
|
|
|
text-decoration: none;
|
2021-08-12 09:27:12 +00:00
|
|
|
color: $primary-content;
|
2023-06-29 10:30:25 +00:00
|
|
|
font: var(--cpd-font-body-md-regular);
|
2020-08-04 20:42:39 +00:00
|
|
|
|
2022-07-27 13:39:29 +00:00
|
|
|
/* Create a flexbox to more easily define the list items */
|
2020-08-04 20:42:39 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
2022-10-13 07:07:34 +00:00
|
|
|
&:hover,
|
2023-01-20 13:46:17 +00:00
|
|
|
&:focus-visible {
|
2024-03-13 13:38:32 +00:00
|
|
|
background-color: var(--cpd-color-bg-action-secondary-hovered);
|
2020-08-04 20:42:39 +00:00
|
|
|
}
|
|
|
|
|
2021-03-01 15:40:46 +00:00
|
|
|
&.mx_AccessibleButton_disabled {
|
|
|
|
opacity: 0.5;
|
|
|
|
cursor: not-allowed;
|
|
|
|
}
|
|
|
|
|
2022-12-12 11:24:14 +00:00
|
|
|
img,
|
|
|
|
.mx_IconizedContextMenu_icon {
|
|
|
|
/* icons */
|
2020-08-04 20:42:39 +00:00
|
|
|
width: 16px;
|
|
|
|
min-width: 16px;
|
|
|
|
max-width: 16px;
|
|
|
|
}
|
|
|
|
|
2022-12-12 11:24:14 +00:00
|
|
|
span.mx_IconizedContextMenu_label {
|
|
|
|
/* labels */
|
2020-08-04 20:42:39 +00:00
|
|
|
width: 100%;
|
|
|
|
flex: 1;
|
|
|
|
|
2022-07-27 13:39:29 +00:00
|
|
|
/* Ellipsize any text overflow */
|
2020-08-04 20:42:39 +00:00
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
2020-09-08 09:19:51 +00:00
|
|
|
|
|
|
|
.mx_IconizedContextMenu_icon + .mx_IconizedContextMenu_label {
|
|
|
|
padding-left: 14px;
|
|
|
|
}
|
2021-07-23 07:46:20 +00:00
|
|
|
|
|
|
|
.mx_BetaCard_betaPill {
|
|
|
|
margin-left: 16px;
|
|
|
|
}
|
2020-08-04 20:42:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-04 16:20:17 +00:00
|
|
|
.mx_IconizedContextMenu_icon {
|
|
|
|
position: relative;
|
|
|
|
width: 16px;
|
|
|
|
height: 16px;
|
|
|
|
|
|
|
|
&::before {
|
2022-12-12 11:24:14 +00:00
|
|
|
content: "";
|
2022-02-17 09:20:15 +00:00
|
|
|
width: inherit;
|
|
|
|
height: inherit;
|
2020-08-04 16:20:17 +00:00
|
|
|
position: absolute;
|
|
|
|
mask-position: center;
|
|
|
|
mask-size: contain;
|
|
|
|
mask-repeat: no-repeat;
|
2024-03-13 13:38:32 +00:00
|
|
|
background-color: var(--cpd-color-icon-primary);
|
2020-08-04 16:20:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.mx_IconizedContextMenu_optionList_red {
|
2022-02-01 17:23:21 +00:00
|
|
|
.mx_IconizedContextMenu_item {
|
2021-11-11 13:37:29 +00:00
|
|
|
color: $alert !important;
|
2020-08-04 16:20:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.mx_IconizedContextMenu_icon::before {
|
2024-03-13 13:38:32 +00:00
|
|
|
background-color: var(--cpd-color-icon-critical-primary);
|
2020-08-04 16:20:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-15 11:39:25 +00:00
|
|
|
.mx_IconizedContextMenu_option_red {
|
|
|
|
color: $alert !important;
|
|
|
|
|
|
|
|
.mx_IconizedContextMenu_icon::before {
|
|
|
|
background-color: $alert;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-04 16:20:17 +00:00
|
|
|
.mx_IconizedContextMenu_active {
|
2022-12-12 11:24:14 +00:00
|
|
|
&.mx_IconizedContextMenu_item,
|
|
|
|
.mx_IconizedContextMenu_item {
|
2021-11-11 13:37:29 +00:00
|
|
|
color: $accent !important;
|
2020-08-04 16:20:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.mx_IconizedContextMenu_icon::before {
|
2021-11-11 13:37:29 +00:00
|
|
|
background-color: $accent;
|
2020-08-04 16:20:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-04 20:42:39 +00:00
|
|
|
&.mx_IconizedContextMenu_compact {
|
|
|
|
.mx_IconizedContextMenu_optionList > * {
|
2024-03-13 13:38:32 +00:00
|
|
|
padding: 8px 16px 8px 12px;
|
2020-08-04 20:42:39 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-04 16:20:17 +00:00
|
|
|
|
2021-07-28 16:39:02 +00:00
|
|
|
.mx_IconizedContextMenu_checked,
|
|
|
|
.mx_IconizedContextMenu_unchecked {
|
2020-08-04 16:20:17 +00:00
|
|
|
margin-left: 16px;
|
|
|
|
margin-right: -5px;
|
2021-07-28 16:39:02 +00:00
|
|
|
}
|
2020-08-04 16:20:17 +00:00
|
|
|
|
2023-04-19 11:34:27 +00:00
|
|
|
.mx_IconizedContextMenu_developerTools::before {
|
|
|
|
mask-image: url("$(res)/img/element-icons/settings/flask.svg");
|
|
|
|
}
|
|
|
|
|
2021-07-28 16:39:02 +00:00
|
|
|
.mx_IconizedContextMenu_checked::before {
|
2024-10-15 10:19:06 +00:00
|
|
|
mask-image: url("@vector-im/compound-design-tokens/icons/check.svg");
|
2021-07-28 16:39:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.mx_IconizedContextMenu_unchecked::before {
|
|
|
|
content: unset;
|
2020-08-04 16:20:17 +00:00
|
|
|
}
|
2021-11-15 11:39:25 +00:00
|
|
|
|
|
|
|
.mx_IconizedContextMenu_sublabel {
|
|
|
|
margin-left: 20px;
|
|
|
|
color: $tertiary-content;
|
|
|
|
}
|
2020-08-04 20:42:39 +00:00
|
|
|
}
|
2022-10-13 07:07:34 +00:00
|
|
|
|
|
|
|
.mx_IconizedContextMenu_item.mx_IconizedContextMenu_itemDestructive {
|
|
|
|
color: $alert !important;
|
|
|
|
}
|