element-web/res/css/structures/_LeftPanel.scss

243 lines
7.8 KiB
SCSS
Raw Normal View History

/*
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.
*/
2021-08-24 12:38:39 +00:00
$roomListCollapsedWidth: 68px;
.mx_MatrixChat--with-avatar {
.mx_LeftPanel,
.mx_LeftPanel .mx_LeftPanel_roomListContainer {
background-color: transparent;
}
}
2021-08-19 14:10:09 +00:00
.mx_LeftPanel_wrapper {
display: flex;
max-width: 50%;
2021-08-24 17:23:12 +00:00
position: relative;
// Contain the amount of layers rendered by constraining what actually needs re-layering via css
contain: layout paint;
.mx_LeftPanel_wrapper--user {
background-color: $roomlist-bg-color;
display: flex;
overflow: hidden;
position: relative;
2021-08-24 12:38:39 +00:00
&[data-collapsed] {
max-width: $roomListCollapsedWidth;
}
}
2021-08-19 14:10:09 +00:00
}
2020-07-17 21:22:18 +00:00
.mx_LeftPanel {
background-color: $roomlist-bg-color;
// TODO decrease this once Spaces launches as it'll no longer need to include the 56px Community Panel
2020-10-10 12:30:06 +00:00
// Create a row-based flexbox for the GroupFilterPanel and the room list
display: flex;
contain: content;
position: relative;
2021-08-24 11:05:46 +00:00
flex-grow: 1;
2021-08-24 14:06:20 +00:00
overflow: hidden;
// Note: The 'room list' in this context is actually everything that isn't the tag
// panel, such as the menu options, breadcrumbs, filtering, etc
2020-07-17 21:22:18 +00:00
.mx_LeftPanel_roomListContainer {
background-color: $roomlist-bg-color;
flex: 1 0 0;
min-width: 0;
// Create another flexbox (this time a column) for the room list components
display: flex;
flex-direction: column;
2020-07-17 21:22:18 +00:00
.mx_LeftPanel_userHeader {
2020-07-10 01:54:11 +00:00
/* 12px top, 12px sides, 20px bottom (using 13px bottom to account
* for internal whitespace in the breadcrumbs)
*/
2020-07-10 17:06:48 +00:00
padding: 12px;
2020-07-10 14:52:46 +00:00
flex-shrink: 0; // to convince safari's layout engine the flexbox is fine
// Create another flexbox column for the rows to stack within
display: flex;
flex-direction: column;
2020-07-13 12:52:50 +00:00
}
2020-07-17 21:22:18 +00:00
.mx_LeftPanel_breadcrumbsContainer {
2020-07-13 12:52:50 +00:00
overflow-y: hidden;
overflow-x: scroll;
margin: 12px 12px 0 12px;
2020-07-13 12:52:50 +00:00
flex: 0 0 auto;
// Create yet another flexbox, this time within the row, to ensure items stay
// aligned correctly. This is also a row-based flexbox.
display: flex;
align-items: center;
contain: content;
2020-07-09 18:24:02 +00:00
2020-07-13 12:52:50 +00:00
&.mx_IndicatorScrollbar_leftOverflow {
mask-image: linear-gradient(90deg, transparent, black 5%);
2020-07-13 12:52:50 +00:00
}
2020-07-09 18:24:02 +00:00
2020-07-13 12:52:50 +00:00
&.mx_IndicatorScrollbar_rightOverflow {
mask-image: linear-gradient(90deg, black, black 95%, transparent);
2020-07-13 12:52:50 +00:00
}
2020-07-09 18:24:02 +00:00
2020-07-13 12:52:50 +00:00
&.mx_IndicatorScrollbar_rightOverflow.mx_IndicatorScrollbar_leftOverflow {
mask-image: linear-gradient(90deg, transparent, black 5%, black 95%, transparent);
}
}
2020-07-17 21:22:18 +00:00
.mx_LeftPanel_filterContainer {
margin-left: 12px;
margin-right: 12px;
2020-07-10 14:52:46 +00:00
flex-shrink: 0; // to convince safari's layout engine the flexbox is fine
2020-07-10 01:15:46 +00:00
// Create a flexbox to organize the inputs
display: flex;
align-items: center;
.mx_RoomSearch_focused, .mx_RoomSearch_hasQuery {
& + .mx_LeftPanel_exploreButton {
// Cheaty way to return the occupied space to the filter input
flex-basis: 0;
margin: 0;
width: 0;
// Don't forget to hide the masked ::before icon,
// using display:none or visibility:hidden would break accessibility
&::before {
content: none;
}
}
}
.mx_LeftPanel_dialPadButton {
width: 32px;
height: 32px;
border-radius: 8px;
2021-11-29 12:52:09 +00:00
background-color: $panel-actions;
position: relative;
margin-left: 8px;
&::before {
content: '';
position: absolute;
top: 8px;
left: 8px;
width: 16px;
height: 16px;
mask-image: url('$(res)/img/element-icons/call/dialpad.svg');
mask-position: center;
mask-size: contain;
mask-repeat: no-repeat;
background: $secondary-content;
}
}
2020-07-17 21:22:18 +00:00
.mx_LeftPanel_exploreButton {
2020-08-14 17:53:56 +00:00
width: 32px;
height: 32px;
border-radius: 8px;
2021-11-29 12:52:09 +00:00
background-color: $panel-actions;
position: relative;
margin-left: 8px;
&::before {
content: '';
position: absolute;
2020-08-14 17:53:56 +00:00
top: 8px;
left: 8px;
width: 16px;
height: 16px;
2020-08-14 17:53:56 +00:00
mask-image: url('$(res)/img/element-icons/roomlist/explore.svg');
mask-position: center;
mask-size: contain;
mask-repeat: no-repeat;
background: $secondary-content;
}
2021-03-24 19:43:33 +00:00
&.mx_LeftPanel_exploreButton_space::before {
mask-image: url('$(res)/img/element-icons/roomlist/browse.svg');
}
}
}
.mx_LeftPanel_roomListFilterCount {
font-size: $font-13px;
2020-08-18 11:00:56 +00:00
font-weight: $font-semi-bold;
margin-left: 12px;
2020-08-18 11:00:56 +00:00
margin-top: 14px;
margin-bottom: -4px; // to counteract the normal roomListWrapper margin-top
}
2020-07-17 21:22:18 +00:00
.mx_LeftPanel_roomListWrapper {
2021-08-24 11:05:46 +00:00
// Make the y-scrollbar more responsive
padding-right: 2px;
overflow: hidden;
2020-07-13 19:41:18 +00:00
margin-top: 10px; // so we're not up against the search/filter
flex: 1 0 0; // needed in Safari to properly set flex-basis
2020-07-17 21:22:18 +00:00
&.mx_LeftPanel_roomListWrapper_stickyBottom {
padding-bottom: 32px;
}
2020-07-17 21:22:18 +00:00
&.mx_LeftPanel_roomListWrapper_stickyTop {
padding-top: 32px;
}
}
2020-07-17 21:22:18 +00:00
.mx_LeftPanel_actualRoomListContainer {
position: relative; // for sticky headers
height: 100%; // ensure scrolling still works
}
}
// These styles override the defaults for the minimized (66px) layout
2020-07-17 21:22:18 +00:00
&.mx_LeftPanel_minimized {
2021-08-24 11:05:46 +00:00
flex-grow: 0;
min-width: unset;
width: unset !important;
2020-07-17 21:22:18 +00:00
.mx_LeftPanel_roomListContainer {
2021-08-24 12:38:39 +00:00
width: $roomListCollapsedWidth;
.mx_LeftPanel_userHeader {
flex-direction: row;
justify-content: center;
}
2020-07-17 21:22:18 +00:00
.mx_LeftPanel_filterContainer {
// Organize the flexbox into a centered column layout
flex-direction: column;
justify-content: center;
.mx_LeftPanel_dialPadButton {
margin-left: 0;
margin-top: 8px;
background-color: transparent;
}
2020-07-17 21:22:18 +00:00
.mx_LeftPanel_exploreButton {
margin-left: 0;
margin-top: 8px;
background-color: transparent;
}
}
}
}
}