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

200 lines
5.1 KiB
SCSS
Raw Normal View History

/*
Copyright 2015, 2016 OpenMarket Ltd
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.
*/
/* a word of explanation about the flex-shrink values employed here:
there are 3 priotized categories of screen real-estate grabbing,
each with a flex-shrink difference of 4 order of magnitude,
so they ideally wouldn't affect each other.
lowest category: .mx_RoomSubList
2018-12-18 14:32:46 +01:00
flex-shrink: 10000000
distribute size of items within the same categery by their size
middle category: .mx_RoomSubList.resized-sized
2018-12-18 14:32:46 +01:00
flex-shrink: 1000
applied when using the resizer, will have a max-height set to it,
to limit the size
highest category: .mx_RoomSubList.resized-all
2018-12-18 14:32:46 +01:00
flex-shrink: 1
small flex-shrink value (1), is only added if you can drag the resizer so far
so in practice you can only assign this category if there is enough space.
*/
.mx_RoomSubList {
2018-10-18 16:25:22 +02:00
display: flex;
flex-direction: column;
}
2019-01-24 15:44:16 +01:00
.mx_RoomSubList_nonEmpty .mx_AutoHideScrollbar_offset {
padding-bottom: 4px;
}
.mx_RoomSubList_labelContainer {
2018-10-19 12:07:36 +02:00
display: flex;
flex-direction: row;
2018-11-05 10:35:38 +01:00
align-items: center;
2018-10-19 14:44:07 +02:00
flex: 0 0 auto;
margin: 0 16px;
height: 36px;
}
.mx_RoomSubList_label {
2018-10-19 12:07:36 +02:00
flex: 1;
cursor: pointer;
display: flex;
align-items: center;
padding: 0 6px;
}
.mx_RoomSubList_label > span {
flex: 1 1 auto;
text-transform: uppercase;
color: $roomsublist-label-fg-color;
2018-05-26 01:07:39 +02:00
font-weight: 700;
2018-10-24 14:03:16 +02:00
font-size: 12px;
margin-left: 8px;
}
.mx_RoomSubList_badge {
flex: 0 0 auto;
2018-11-05 10:35:38 +01:00
border-radius: 8px;
color: $accent-fg-color;
font-weight: 600;
2018-10-22 18:16:36 +02:00
font-size: 12px;
2018-11-05 10:35:38 +01:00
padding: 0 5px;
background-color: $roomtile-name-color;
cursor: pointer;
}
.mx_RoomSubList_addRoom, .mx_RoomSubList_badge {
margin-left: 7px;
}
2018-10-19 12:07:36 +02:00
.mx_RoomSubList_addRoom {
2019-02-15 19:16:10 +01:00
background-color: $roomheader-addroom-bg-color;
2018-11-05 14:25:28 +01:00
border-radius: 10px; // 16/2 + 2 padding
height: 16px;
flex: 0 0 16px;
2019-02-15 19:16:10 +01:00
position: relative;
&::before {
2019-02-15 19:16:10 +01:00
background-color: $roomheader-addroom-fg-color;
mask: url('$(res)/img/icons-room-add.svg');
mask-repeat: no-repeat;
mask-position: center;
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
2018-10-19 12:07:36 +02:00
}
.mx_RoomSubList_badgeHighlight {
2018-12-20 13:46:43 +01:00
background-color: $warning-color;
}
.mx_RoomSubList_chevron {
pointer-events: none;
mask: url('$(res)/img/feather-customised/dropdown-arrow.svg');
mask-repeat: no-repeat;
2018-11-05 10:09:05 +01:00
transition: transform 0.2s ease-in;
width: 10px;
height: 6px;
margin-left: 2px;
background-color: $roomsublist-label-fg-color;
}
.mx_RoomSubList_chevronDown {
transform: rotateZ(0deg);
}
.mx_RoomSubList_chevronUp {
transform: rotateZ(180deg);
}
.mx_RoomSubList_chevronRight {
transform: rotateZ(-90deg);
}
2018-11-01 16:34:12 +01:00
.mx_RoomSubList_scroll {
/* let rooms list grab as much space as it needs (auto),
potentially overflowing and showing a scrollbar */
2018-11-01 16:34:12 +01:00
flex: 0 1 auto;
padding: 0 8px;
}
.collapsed {
.mx_RoomSubList_scroll {
padding: 0;
}
.mx_RoomSubList_labelContainer {
margin-right: 8px;
margin-left: 2px;
}
.mx_RoomSubList_addRoom {
margin-left: 3px;
margin-right: 10px;
}
.mx_RoomSubList_label > span {
display: none;
}
}
// overflow indicators
.mx_RoomSubList:not(.resized-all) > .mx_RoomSubList_scroll {
&.mx_IndicatorScrollbar_topOverflow::before,
&.mx_IndicatorScrollbar_bottomOverflow::after {
position: sticky;
left: 0;
right: 0;
height: 8px;
content: "";
display: block;
z-index: 100;
pointer-events: none;
}
&.mx_IndicatorScrollbar_topOverflow > .mx_AutoHideScrollbar_offset {
margin-top: -8px;
}
&.mx_IndicatorScrollbar_bottomOverflow > .mx_AutoHideScrollbar_offset {
margin-bottom: -8px;
}
&.mx_IndicatorScrollbar_topOverflow::before {
top: 0;
transition: background-image 0.1s ease-in;
2019-02-13 16:06:24 +01:00
background: linear-gradient(to top, $panel-gradient);
}
/*
// for now, we remove the bottomOverflow entirely as we don't want to
// lose the screen real-estate due to a bg-colored gradient, but we also
// don't want to use drop shadows and risk a confusing hierarchy of cards.
// so, instead, we hard-clip at the bottom but soft-clip at the top.
&.mx_IndicatorScrollbar_bottomOverflow::after {
bottom: 0;
transition: background-image 0.1s ease-in;
margin: 0px -8px;
background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.0));
}
*/
2018-10-16 14:55:35 +02:00
}