fix media queries in component based element call.

This commit is contained in:
Timo K.
2026-09-07 14:50:36 +02:00
parent 218ee46b7d
commit 365204d04c
13 changed files with 114 additions and 21 deletions
+2 -2
View File
@@ -68,7 +68,7 @@
}
/* Hide everything but the subtitle in small windows */
@media (max-height: 450px) {
@container element-call (max-height: 450px) {
.bar {
display: none;
}
@@ -166,7 +166,7 @@
}
/* Hide everything but the subtitle in small windows */
@media (max-height: 450px) {
@container element-call (max-height: 450px) {
.bar:has(.subtitle) > header {
grid-template-rows: var(--cpd-space-4x) minmax(var(--cpd-space-5x), auto);
grid-template-areas: "." "subtitle";
+1 -1
View File
@@ -107,7 +107,7 @@ Please see LICENSE in the repository root for full details.
gap: var(--cpd-space-1-5x);
}
@media (min-width: 800px) {
@container element-call (min-width: 800px) {
.headerLogo,
.leftNav.hideMobile,
.rightNav.hideMobile {
+11 -1
View File
@@ -33,7 +33,8 @@ the app and for the component build. */
@import url("@fontsource/inconsolata/700.css");
@import url("normalize.css/normalize.css") layer(normalize);
@import url("@vector-im/compound-design-tokens/assets/web/css/compound-design-tokens.css") layer(compound);
@import url("@vector-im/compound-design-tokens/assets/web/css/compound-design-tokens.css")
layer(compound);
@import url("@vector-im/compound-web/dist/style.css") layer(compound.components);
:root {
@@ -76,6 +77,15 @@ the app and for the component build. */
--video-tile-background: var(--cpd-color-bg-subtle-secondary);
}
/* The breakpoints in Element Call's stylesheets are container queries against
this element rather than media queries against the viewport. For the standalone
app the two are the same thing, since the root is the page; for a host that
embeds Element Call in a corner of its own page they are not, and it is the
corner that the layout has to fit. */
[data-element-call-root] {
container: element-call / size;
}
.cpd-theme-dark {
--cpd-color-border-accent: var(--cpd-color-green-1100);
--stopgap-color-on-solid-accent: var(--cpd-color-text-primary);
+1 -1
View File
@@ -10,7 +10,7 @@
width: fit-content;
}
@media (max-width: 420px) {
@container element-call (max-width: 420px) {
.reactionPopupMenu {
--reaction-button-padding: 8px;
--reaction-button-fontsize: 16px;
+8 -8
View File
@@ -77,7 +77,7 @@ Please see LICENSE in the repository root for full details.
}
/*First hide the logo*/
@media (max-width: 750px) {
@container element-call (max-width: 750px) {
.logo {
display: none;
}
@@ -94,7 +94,7 @@ Please see LICENSE in the repository root for full details.
With the logo hidden >500px is enough space to show overflow, buttons, layout.
Once we exceed 500 we hide everything except the buttons.
*/
@media (max-width: 500px) {
@container element-call (max-width: 500px) {
.footer {
grid-template-areas: "buttons buttons buttons";
}
@@ -115,27 +115,27 @@ Once we exceed 500 we hide everything except the buttons.
}
}
@media (max-height: 800px) {
@container element-call (max-height: 800px) {
.footer {
padding-block: var(--cpd-space-8x)
calc(env(safe-area-inset-bottom) + var(--cpd-space-8x));
}
}
@media (max-height: 400px) {
@container element-call (max-height: 400px) {
.footer {
padding-block: var(--cpd-space-4x)
calc(env(safe-area-inset-bottom) + var(--cpd-space-4x));
}
}
@media (max-width: 370px) {
@container element-call (max-width: 370px) {
.shareScreen {
display: none;
}
/* PIP custom css */
@media (max-height: 400px) {
@container element-call (max-height: 400px) {
.shareScreen {
display: flex;
}
@@ -148,13 +148,13 @@ Once we exceed 500 we hide everything except the buttons.
}
}
@media (max-width: 320px) {
@container element-call (max-width: 320px) {
.raiseHand {
display: none;
}
}
@media (min-width: 800px) {
@container element-call (min-width: 800px) {
.buttons {
gap: var(--cpd-space-4x);
}
+1 -1
View File
@@ -30,7 +30,7 @@ Please see LICENSE in the repository root for full details.
block-size: 140px;
}
@media (max-width: 600px) {
@container element-call (max-width: 600px) {
/* Give the PiP a portrait aspect ratio */
.pip[data-size="sm"] {
inline-size: 88px;
+1 -1
View File
@@ -25,7 +25,7 @@ Please see LICENSE in the repository root for full details.
var(--content-inset-left);
}
@media (min-width: 600px) {
@container element-call (min-width: 600px) {
.pip {
inline-size: 180px;
block-size: 135px;
+1 -1
View File
@@ -74,7 +74,7 @@ Please see LICENSE in the repository root for full details.
margin-bottom: 44px;
}
@media (min-width: 800px) {
@container element-call (min-width: 800px) {
.logo {
display: none;
}
+1 -1
View File
@@ -75,7 +75,7 @@ spotlight tile is maximised and displaying video, apply a gradient background. *
background: none;
}
@media (max-width: 320px) {
@container element-call (max-width: 320px) {
.invite {
display: none;
}
+2 -2
View File
@@ -28,13 +28,13 @@ Please see LICENSE in the repository root for full details.
color: var(--cpd-color-theme-primary) !important;
}
@media (max-width: 500px) {
@container element-call (max-width: 500px) {
.join {
width: 100%;
}
}
@media (min-height: 650px) {
@container element-call (min-height: 650px) {
.content {
gap: var(--cpd-space-10x);
}
+1 -1
View File
@@ -71,7 +71,7 @@ video.mirror {
);
}
@media (max-width: 550px) {
@container element-call (max-width: 550px) {
.preview {
margin-inline: 0;
border-radius: 0;