Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Tidy up _AppsDrawer.pcss #10775

Merged
merged 13 commits into from
May 11, 2023
143 changes: 72 additions & 71 deletions res/css/views/rooms/_AppsDrawer.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

$MiniAppTileHeight: 220px;
/* TODO this should be 300px but that's too large */
$MinWidth: 240px;

.mx_AppsDrawer {
--AppTile_mini-height: 220px;
--minWidth: 240px; /* TODO this should be 300px but that's too large */

margin: var(--container-gap-width);
/* The left side gap is fully handled by this margin. To prohibit bleeding on webkit browser. */
margin-right: calc(var(--container-gap-width) / 2);
Expand Down Expand Up @@ -94,7 +93,7 @@ $MinWidth: 240px;

.mx_AppTile {
width: 50%;
min-width: $MinWidth;
min-width: var(--minWidth);
}

&.mx_AppsDrawer_2apps .mx_AppTile {
Expand All @@ -103,7 +102,7 @@ $MinWidth: 240px;
&:nth-child(3) {
flex-grow: 1;
width: 0 !important;
min-width: $MinWidth !important;
min-width: var(--minWidth) !important;
}
}
&.mx_AppsDrawer_3apps .mx_AppTile {
Expand All @@ -112,7 +111,7 @@ $MinWidth: 240px;
&:nth-child(3) {
flex-grow: 1;
width: 0 !important;
min-width: $MinWidth !important;
min-width: var(--minWidth) !important;
}
}
}
Expand Down Expand Up @@ -174,7 +173,7 @@ $MinWidth: 240px;
padding: 0;
display: flex;
flex-direction: column;
height: $MiniAppTileHeight;
height: var(--AppTile_mini-height);
}

.mx_AppTile .mx_AppTile_persistedWrapper,
Expand Down Expand Up @@ -210,10 +209,10 @@ $MinWidth: 240px;
.mx_WidgetAvatar {
margin-right: 12px;
}
}

.mx_AppTileMenuBarTitle > :last-child {
margin-left: 9px;
> :last-child {
margin-left: 9px;
}
}

.mx_AppTileMenuBarWidgets {
Expand All @@ -224,31 +223,33 @@ $MinWidth: 240px;
}

.mx_AppTileMenuBar_iconButton {
height: 24px;
--size: 24px; /* Size of the button. Its height and width values should be same */

margin: 0 4px;
position: relative;
width: 24px;
height: var(--size);
width: var(--size);

&::before,
&:hover::after {
content: "";
position: absolute;
height: var(--size);
width: var(--size);
}

&::before {
background-color: $muted-fg-color;
content: "";
height: 24px;
mask-position: center;
mask-repeat: no-repeat;
mask-size: 12px;
position: absolute;
width: 24px;
}

&:hover::after {
background-color: $panel-actions;
border-radius: 50%;
content: "";
height: 24px;
left: 0;
position: absolute;
top: 0;
width: 24px;
}

&.mx_AppTileMenuBar_iconButton--collapse::before {
Expand All @@ -272,19 +273,35 @@ $MinWidth: 240px;
}
}

.mx_AppTileBody {
height: 100%;
.mx_AppTileBody,
.mx_AppTileBody_mini {
width: 100%;
overflow: hidden;
border-radius: 8px;
height: var(--AppTileBody-height);

iframe {
border: none;
width: 100%;
height: 100%;
}
}

.mx_AppTileBody {
--AppTileBody-height: 100%;

background-color: $widget-body-bg-color;

iframe {
overflow: hidden;
padding: 0;
margin: 0;
display: block;
}
}

.mx_AppTileBody_mini {
height: $MiniAppTileHeight;
width: 100%;
overflow: hidden;
border-radius: 8px;
--AppTileBody-height: var(--AppTile_mini-height);
}

.mx_AppTile .mx_AppTileBody,
Expand All @@ -294,22 +311,6 @@ $MinWidth: 240px;
flex: 1;
}

.mx_AppTileBody_mini iframe {
border: none;
width: 100%;
height: 100%;
}

.mx_AppTileBody iframe {
width: 100%;
height: 100%;
overflow: hidden;
border: none;
padding: 0;
margin: 0;
display: block;
}

.mx_AppPermissionWarning {
text-align: center;
display: flex;
Expand All @@ -318,6 +319,11 @@ $MinWidth: 240px;
justify-content: center;
align-items: center;
font-size: $font-16px;

h4 {
margin: 0;
padding: 0;
}
}

.mx_AppPermissionWarning_row {
Expand All @@ -332,30 +338,25 @@ $MinWidth: 240px;
font-weight: var(--font-semi-bold);
}

.mx_AppPermissionWarning h4 {
margin: 0;
padding: 0;
}

.mx_AppPermissionWarning_helpIcon {
margin-top: 1px;
margin-right: 2px;
width: 10px;
height: 10px;
display: inline-block;
}

.mx_AppPermissionWarning_helpIcon::before {
display: inline-block;
background-color: $accent;
mask-repeat: no-repeat;
mask-size: 12px;
width: 12px;
height: 12px;
mask-position: center;
content: "";
vertical-align: middle;
mask-image: url("$(res)/img/feather-customised/help-circle.svg");
&::before {
display: inline-block;
background-color: $accent;
mask-repeat: no-repeat;
mask-size: 12px;
width: 12px;
height: 12px;
mask-position: center;
content: "";
vertical-align: middle;
mask-image: url("$(res)/img/feather-customised/help-circle.svg");
}
}

.mx_AppPermissionWarning_tooltip {
Expand All @@ -380,14 +381,18 @@ $MinWidth: 240px;
/* match bg of border so that the cut corners have the right fill */
background-color: $widget-body-bg-color !important;
border-radius: 8px;
}

.mx_AppLoading .mx_Spinner {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
iframe {
display: none;
}

.mx_Spinner {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
}

.mx_AppLoading_spinner_fadeIn {
Expand All @@ -406,10 +411,6 @@ $MinWidth: 240px;
}
}

.mx_AppLoading iframe {
display: none;
}

.mx_AppsDrawer_resizing .mx_AppTile_persistedWrapper {
z-index: 1;
}