Skip to content

A platform for community discussion. Free, open, simple.

DEV: Remove obsolete `@supports` blocks (#36176)

Jarek Radosz5e126a9f3f88
diff --git a/app/assets/stylesheets/common/base/_topic-list.scss b/app/assets/stylesheets/common/base/_topic-list.scss
index e6ad14d89c5..c7d551595bd 100644
--- a/app/assets/stylesheets/common/base/_topic-list.scss
+++ b/app/assets/stylesheets/common/base/_topic-list.scss
@@ -48,23 +48,17 @@
}
.category-logo.aspect-image {
+ --max-height: 150px;
width: auto;
- max-height: 150px;
-}
+ max-height: var(--max-height);
+ max-width: 100%;
+ height: auto;
-@supports (--custom: property) {
- .category-logo.aspect-image {
- --max-height: 150px;
- max-height: var(--max-height);
+ img {
+ width: calc(var(--max-height) * var(--aspect-ratio));
max-width: 100%;
- height: auto;
-
- img {
- width: calc(var(--max-height) * var(--aspect-ratio));
- max-width: 100%;
- height: inherit;
- max-height: var(--max-height);
- }
+ height: inherit;
+ max-height: var(--max-height);
}
}
diff --git a/app/assets/stylesheets/common/base/category-list.scss b/app/assets/stylesheets/common/base/category-list.scss
index 07a281de642..cf82b7e13da 100644
--- a/app/assets/stylesheets/common/base/category-list.scss
+++ b/app/assets/stylesheets/common/base/category-list.scss
@@ -101,19 +101,12 @@
}
.category-logo.aspect-image img {
+ --height: 40px;
display: block;
- width: auto;
- height: 40px;
margin: 0 auto 1em auto;
- }
-
- @supports (--custom: property) {
- .category-logo.aspect-image img {
- --height: 40px;
- height: var(--height);
- width: calc(var(--height) * var(--aspect-ratio));
- max-width: 100%;
- }
+ height: var(--height);
+ width: calc(var(--height) * var(--aspect-ratio));
+ max-width: 100%;
}
}
diff --git a/app/assets/stylesheets/common/base/compose.scss b/app/assets/stylesheets/common/base/compose.scss
index 130d578dce1..0d615762a99 100644
--- a/app/assets/stylesheets/common/base/compose.scss
+++ b/app/assets/stylesheets/common/base/compose.scss
@@ -1042,14 +1042,10 @@ html.composer-open:not(.has-full-page-chat) {
#reply-control {
&.fullscreen {
// important needed because of inline styles when height is changed manually with grippie
- height: 100vh !important;
+ height: calc(var(--composer-vh, 1vh) * 100) !important;
max-height: 100%; // prevents devices from miscalculating using vh
z-index: z("header") + 1;
- @supports (--custom: property) {
- height: calc(var(--composer-vh, 1vh) * 100) !important;
- }
-
.grippie {
display: none;
}
diff --git a/app/assets/stylesheets/common/base/directory.scss b/app/assets/stylesheets/common/base/directory.scss
index 9defcc760e1..2ca5bf5fc43 100644
--- a/app/assets/stylesheets/common/base/directory.scss
+++ b/app/assets/stylesheets/common/base/directory.scss
@@ -167,13 +167,9 @@
&__header,
&__body,
&__row {
- display: contents;
-
- @supports (grid-template-rows: subgrid) {
- display: grid;
- grid-column: 1 / -1;
- grid-template-columns: subgrid;
- }
+ display: grid;
+ grid-column: 1 / -1;
+ grid-template-columns: subgrid;
}
&__column-header,
diff --git a/app/assets/stylesheets/common/base/onebox.scss b/app/assets/stylesheets/common/base/onebox.scss
index 6832003ab81..d61da588c40 100644
--- a/app/assets/stylesheets/common/base/onebox.scss
+++ b/app/assets/stylesheets/common/base/onebox.scss
@@ -191,6 +191,10 @@ aside.onebox {
[style*="--aspect-ratio"] > :first-child {
width: 100%;
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 100%;
}
[style*="--aspect-ratio"] > img {
@@ -199,58 +203,49 @@ aside.onebox {
// this allows us to load all onebox images without jiggle
// see: http://cssmojo.com/aspect-ratio-using-custom-properties-and-calc/
- @supports (--custom: property) {
- .aspect-image {
- max-height: 170px;
-
- --magic-ratio: calc(var(--aspect-ratio) + 0.15);
- width: calc(128px * var(--magic-ratio));
- max-width: 20%;
- float: left;
- margin-right: 1em;
- height: auto;
-
- img {
- width: 100%;
- height: inherit;
- max-width: initial;
- max-height: initial;
- float: none;
- }
- }
+ .aspect-image {
+ max-height: 170px;
- // full size images for instagram, twitter, etc.
- .aspect-image-full-size {
- margin: 0.5em 0;
- max-height: 100%;
- width: calc(500px * var(--aspect-ratio));
- max-width: 100%;
+ --magic-ratio: calc(var(--aspect-ratio) + 0.15);
+ width: calc(128px * var(--magic-ratio));
+ max-width: 20%;
+ float: left;
+ margin-right: 1em;
+ height: auto;
- img {
- width: 100%;
- height: inherit;
- max-width: initial;
- max-height: initial;
- float: none;
- }
+ img {
+ width: 100%;
+ height: inherit;
+ max-width: initial;
+ max-height: initial;
+ float: none;
}
+ }
- [style*="--aspect-ratio"] {
- position: relative;
- }
+ // full size images for instagram, twitter, etc.
+ .aspect-image-full-size {
+ margin: 0.5em 0;
+ max-height: 100%;
+ width: calc(500px * var(--aspect-ratio));
+ max-width: 100%;
- [style*="--aspect-ratio"]::before {
- content: "";
- display: block;
- padding-bottom: calc(100% / (var(--aspect-ratio)));
+ img {
+ width: 100%;
+ height: inherit;
+ max-width: initial;
+ max-height: initial;
+ float: none;
}
+ }
- [style*="--aspect-ratio"] > :first-child {
- position: absolute;
- top: 0;
- left: 0;
- height: 100%;
- }
+ [style*="--aspect-ratio"] {
+ position: relative;
+ }
+
+ [style*="--aspect-ratio"]::before {
+ content: "";
+ display: block;
+ padding-bottom: calc(100% / (var(--aspect-ratio)));
}
p:last-child {
@@ -1029,14 +1024,10 @@ aside.onebox.mixcloud-preview {
}
}
-@supports (aspect-ratio: 1) {
- // Not supported on iOS < 15. For those devices, we just
- // use the fixed width/height attributes on the iframe
- .youtube-onebox {
- width: 100%;
- height: auto;
- aspect-ratio: 16/9;
- }
+.youtube-onebox {
+ width: 100%;
+ height: auto;
+ aspect-ratio: 16/9;
}
// Force oneboxed videos to 16:9 aspect ratio
@@ -1105,14 +1096,6 @@ iframe.loom-onebox {
aspect-ratio: 16/9;
}
-@supports not (aspect-ratio: auto) {
- iframe.vimeo-onebox,
- iframe.loom-onebox {
- width: 690px;
- height: 388px;
- }
-}
-
.video-container {
.notice {
background-color: var(--highlight-bg);
diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss
index 3946f09e749..ccad39b3b54 100644
--- a/app/assets/stylesheets/common/base/topic-post.scss
+++ b/app/assets/stylesheets/common/base/topic-post.scss
@@ -109,11 +109,6 @@
max-width: 100%;
height: auto;
display: inline-block; // Ensure dimensions are maintained even after load error
-
- @supports not (aspect-ratio: 1) {
- // (see javascripts/discourse/app/initializers/image-aspect-ratio.js)
- height: var(--calculated-height);
- }
}
svg {
diff --git a/app/assets/stylesheets/common/components/footer-nav.scss b/app/assets/stylesheets/common/components/footer-nav.scss
index acc0d0464a1..f8c4ae71cf4 100644
--- a/app/assets/stylesheets/common/components/footer-nav.scss
+++ b/app/assets/stylesheets/common/components/footer-nav.scss
@@ -43,6 +43,7 @@ html.footer-nav-visible {
&.visible {
bottom: 0;
+ padding-bottom: max(5px, env(safe-area-inset-bottom));
}
.footer-nav-widget {
@@ -64,17 +65,9 @@ html.footer-nav-visible {
}
}
-@supports (padding: max(0px)) {
- .footer-nav.visible {
- padding-bottom: max(5px, env(safe-area-inset-bottom));
- }
-}
-
-@supports (backdrop-filter: blur(10px)) {
- html:not(.footer-nav-ipad) .footer-nav {
- background-color: rgb(var(--header_background-rgb), 0.7);
- backdrop-filter: blur(20px);
- }
+html:not(.footer-nav-ipad) .footer-nav {
+ background-color: rgb(var(--header_background-rgb), 0.7);
+ backdrop-filter: blur(20px);
}
html.footer-nav-ipad {