element-web/res/css/views/rooms/_RoomBreadcrumbs2.scss
Travis Ralston 0354bf9b6d Reimplement breadcrumbs for new room list
This all-new component handles breadcrumbs a bit more smoothly for the app by always listening to changes even if the component isn't present. This allows the breadcrumbs to remain up to date for when the user re-enables breadcrumbs.

The new behaviour is that we turn breadcrumbs on once the user has a room, and we don't turn it back off for them.

This also introduces a new animation which is more stable and not laggy, though instead of sliding the breadcrumbs pop. This might be undesirable - to be reviewed.
2020-06-08 17:11:58 -06:00

53 lines
1.4 KiB
SCSS

/*
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.
*/
@keyframes breadcrumb-popin {
0% {
// Ideally we'd use `width` instead of `opacity`, but we only
// have 16 nanoseconds to render the frame, and width is expensive.
opacity: 0;
transform: scale(0);
}
100% {
opacity: 1;
transform: scale(1);
}
}
.mx_RoomBreadcrumbs2 {
// Create a flexbox for the crumbs
display: flex;
flex-direction: row;
align-items: flex-start;
width: 100%;
.mx_RoomBreadcrumbs2_crumb {
margin-right: 8px;
width: 32px;
// React loves to add elements, so only target the one we want to animate
&:first-child {
animation: breadcrumb-popin 0.3s;
}
}
.mx_RoomBreadcrumbs2_placeholder {
font-weight: 600;
font-size: $font-14px;
line-height: 32px; // specifically to match the height this is not scaled
height: 32px;
}
}