Skip to content

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

DEV: Introduce postcss minmax transform (#31885)

David Taylor9e7384298b26
diff --git a/app/assets/javascripts/theme-transpiler/package.json b/app/assets/javascripts/theme-transpiler/package.json
index a3875b54c87..9163008dc5a 100644
--- a/app/assets/javascripts/theme-transpiler/package.json
+++ b/app/assets/javascripts/theme-transpiler/package.json
@@ -25,6 +25,7 @@
"polyfill-crypto.getrandomvalues": "^1.0.0",
"postcss": "^8.5.3",
"postcss-js": "^4.0.1",
+ "postcss-media-minmax": "^5.0.0",
"source-map-js": "^1.2.1",
"terser": "^5.39.0"
},
diff --git a/app/assets/javascripts/theme-transpiler/postcss.js b/app/assets/javascripts/theme-transpiler/postcss.js
index 3c0036dc993..42c6780fb77 100644
--- a/app/assets/javascripts/theme-transpiler/postcss.js
+++ b/app/assets/javascripts/theme-transpiler/postcss.js
@@ -2,6 +2,7 @@ import "core-js/actual/url";
import postcssLightDark from "@csstools/postcss-light-dark-function";
import autoprefixer from "autoprefixer";
import postcss from "postcss";
+import minmax from "postcss-media-minmax";
import { browsers } from "../discourse/config/targets";
import postcssVariablePrefixer from "./postcss-variable-prefixer";
@@ -9,6 +10,7 @@ const postCssProcessor = postcss([
autoprefixer({
overrideBrowserslist: browsers,
}),
+ minmax(),
postcssLightDark,
postcssVariablePrefixer(),
]);
diff --git a/app/assets/stylesheets/admin/admin_base.scss b/app/assets/stylesheets/admin/admin_base.scss
index f20561a3287..2a7581a72ab 100644
--- a/app/assets/stylesheets/admin/admin_base.scss
+++ b/app/assets/stylesheets/admin/admin_base.scss
@@ -91,7 +91,7 @@ $mobile-breakpoint: 700px;
position: relative;
.nav-stacked {
- @media screen and (max-width: 700px) {
+ @media screen and (width <= 700px) {
margin: 0;
}
}
@@ -109,7 +109,7 @@ $mobile-breakpoint: 700px;
&.admin-site-settings-category {
overflow: hidden;
- @media (max-width: 500px) {
+ @media (width <= 500px) {
background-color: var(--primary-very-low);
}
}
@@ -144,7 +144,7 @@ $mobile-breakpoint: 700px;
display: none;
}
- @media screen and (max-width: 970px) and (min-width: 768px) {
+ @media screen and (width <= 970px) and (width >= 768px) {
td,
th {
padding: 6px 4px;
@@ -174,7 +174,7 @@ $mobile-breakpoint: 700px;
.admin-contents table.grid {
// Table switches to grid for narrow screens
- @media screen and (max-width: 767px) {
+ @media screen and (width <= 767px) {
thead {
display: none;
}
@@ -241,7 +241,7 @@ $mobile-breakpoint: 700px;
}
}
- @media screen and (min-width: 550px) {
+ @media screen and (width >= 550px) {
tr {
grid-template-columns: repeat(6, 1fr);
}
@@ -593,7 +593,7 @@ $mobile-breakpoint: 700px;
input[type="text"] {
min-width: 15em;
- @media screen and (max-width: 500px) {
+ @media screen and (width <= 500px) {
box-sizing: border-box;
width: 100%;
}
@@ -615,7 +615,7 @@ $mobile-breakpoint: 700px;
.search-logs-filter {
margin-left: auto;
- @media screen and (max-width: 700px) {
+ @media screen and (width <= 700px) {
flex: 1 1 100%;
margin-left: 0;
}
@@ -793,7 +793,7 @@ $mobile-breakpoint: 700px;
// Hide the search checkbox for very small screens
// Todo: find somewhere to display it - probably requires switching its order in the html
- @media (max-width: 550px) {
+ @media (width <= 550px) {
display: none;
}
}
@@ -839,7 +839,7 @@ $mobile-breakpoint: 700px;
width: 250px;
}
- @media (max-width: 500px) {
+ @media (width <= 500px) {
width: 50%;
}
@@ -876,7 +876,7 @@ $mobile-breakpoint: 700px;
transform: translateX(250px);
}
- @media (max-width: 500px) {
+ @media (width <= 500px) {
transition: transform 0.3s ease;
transform: translateX(50%);
}
@@ -947,7 +947,7 @@ section.details {
}
}
-@media all and (min-width: 320px) and (max-width: 500px) {
+@media all and (width >= 320px) and (width <= 500px) {
.full-width {
margin: 0;
}
diff --git a/app/assets/stylesheets/admin/admin_filter.scss b/app/assets/stylesheets/admin/admin_filter.scss
index a717fb050f2..b70055b60ad 100644
--- a/app/assets/stylesheets/admin/admin_filter.scss
+++ b/app/assets/stylesheets/admin/admin_filter.scss
@@ -7,7 +7,7 @@
.admin-filter__input-container {
min-width: 50%;
- @media screen and (max-width: 500px) {
+ @media screen and (width <= 500px) {
width: 100%;
}
@@ -15,7 +15,7 @@
min-width: 15em;
margin: 0;
- @media screen and (max-width: 500px) {
+ @media screen and (width <= 500px) {
box-sizing: border-box;
width: 100%;
}
diff --git a/app/assets/stylesheets/admin/admin_report.scss b/app/assets/stylesheets/admin/admin_report.scss
index 26f4d7db64a..96d98093cb2 100644
--- a/app/assets/stylesheets/admin/admin_report.scss
+++ b/app/assets/stylesheets/admin/admin_report.scss
@@ -216,7 +216,7 @@
border-bottom: 1px solid var(--primary-low);
padding-bottom: 0.5em;
- @media screen and (max-width: 400px) {
+ @media screen and (width <= 400px) {
flex-wrap: wrap;
}
diff --git a/app/assets/stylesheets/admin/admin_report_counters.scss b/app/assets/stylesheets/admin/admin_report_counters.scss
index c5e1d5aac6a..6edbe51f393 100644
--- a/app/assets/stylesheets/admin/admin_report_counters.scss
+++ b/app/assets/stylesheets/admin/admin_report_counters.scss
@@ -24,7 +24,7 @@
}
}
- @media screen and (max-width: 400px) {
+ @media screen and (width <= 400px) {
&.title .d-icon {
display: none;
}
diff --git a/app/assets/stylesheets/admin/customize.scss b/app/assets/stylesheets/admin/customize.scss
index 29a3cc9db75..ddd7253f8bd 100644
--- a/app/assets/stylesheets/admin/customize.scss
+++ b/app/assets/stylesheets/admin/customize.scss
@@ -206,11 +206,11 @@
justify-content: space-between;
width: 79.7%;
- @media screen and (max-width: 700px) {
+ @media screen and (width <= 700px) {
width: 100%;
}
- @media screen and (min-width: 700px) and (max-width: 768px) {
+ @media screen and (width >= 700px) and (width <= 768px) {
width: 73%;
}
@@ -398,11 +398,11 @@
border-left: 1px solid var(--primary-low);
width: 100%;
- @media screen and (max-height: 1000px) {
+ @media screen and (height <= 1000px) {
max-height: 50vh;
}
- @media screen and (max-height: 800px) {
+ @media screen and (height <= 800px) {
max-height: 40vh;
}
@@ -960,7 +960,7 @@
}
}
- @media screen and (max-width: 880px) {
+ @media screen and (width <= 880px) {
table.grid {
thead {
display: none;
@@ -984,7 +984,7 @@
}
}
- @media screen and (max-width: 580px) {
+ @media screen and (width <= 580px) {
table.grid {
tr td.editing-input {
grid-column-start: 1;
diff --git a/app/assets/stylesheets/admin/dashboard.scss b/app/assets/stylesheets/admin/dashboard.scss
index c9c4a621243..72e772f5b9d 100644
--- a/app/assets/stylesheets/admin/dashboard.scss
+++ b/app/assets/stylesheets/admin/dashboard.scss
@@ -120,7 +120,7 @@
border-bottom: 1px solid var(--primary-low);
padding-bottom: 0.5em;
- @media screen and (max-width: 400px) {
+ @media screen and (width <= 400px) {
flex-wrap: wrap;
}
@@ -242,7 +242,7 @@
}
}
- @media screen and (max-width: 400px) {
+ @media screen and (width <= 400px) {
flex-wrap: wrap;
.storage-stats,
@@ -598,7 +598,7 @@
.update-header {
flex: 1 1 100%;
- @media screen and (max-width: 650px) {
+ @media screen and (width <= 650px) {
margin: 0;
}
diff --git a/app/assets/stylesheets/admin/staff_logs.scss b/app/assets/stylesheets/admin/staff_logs.scss
index a1c5efe160a..acea3cc52f4 100644
--- a/app/assets/stylesheets/admin/staff_logs.scss
+++ b/app/assets/stylesheets/admin/staff_logs.scss
@@ -10,7 +10,7 @@
width: 100%;
word-wrap: break-word;
- @media screen and (min-width: 550px) and (max-width: 767px) {
+ @media screen and (width >= 550px) and (width <= 767px) {
table.staff-logs tr {
display: grid;
grid-template-rows: auto auto;
@@ -171,11 +171,11 @@
width: 140px;
}
- @media screen and (min-width: 900px) {
+ @media screen and (width >= 900px) {
margin-left: auto;
}
- @media screen and (max-width: 899px) {
+ @media screen and (width <= 899px) {
margin-top: 1em;
}
}
@@ -196,13 +196,13 @@ table.screened-ip-addresses {
}
}
-@media screen and (min-width: 550px) {
+@media screen and (width >= 550px) {
table.screened-ip-addresses tr {
grid-template-columns: repeat(5, 1fr) auto;
}
}
-@media screen and (max-width: 549px) {
+@media screen and (width <= 549px) {
table.screened-ip-addresses tr {
td.actions {
grid-row: 3;
@@ -387,7 +387,7 @@ table.search-logs-list {
width: 60%;
word-wrap: break-word;
- @media screen and (max-width: 767px) {
+ @media screen and (width <= 767px) {
width: 100%;
}
}
@@ -397,7 +397,7 @@ table.search-logs-list {
text-align: center;
}
- @media screen and (min-width: 550px) {
+ @media screen and (width >= 550px) {
tr {
td.term {
grid-column-start: span 3;
diff --git a/app/assets/stylesheets/common/base/activation.scss b/app/assets/stylesheets/common/base/activation.scss
index 01d584511a9..419b7543b9f 100644
--- a/app/assets/stylesheets/common/base/activation.scss
+++ b/app/assets/stylesheets/common/base/activation.scss
@@ -25,7 +25,7 @@
background: var(--secondary);
margin: 10vh auto 1em auto;
- @media screen and (max-height: 700px) {
+ @media screen and (height <= 700px) {
margin: 1em auto 1em auto;
}
}
diff --git a/app/assets/stylesheets/common/base/compose.scss b/app/assets/stylesheets/common/base/compose.scss
index b6d3acaed38..cca18dde3aa 100644
--- a/app/assets/stylesheets/common/base/compose.scss
+++ b/app/assets/stylesheets/common/base/compose.scss
@@ -32,7 +32,7 @@ html.composer-open {
background-color: var(--secondary);
box-shadow: var(--shadow-composer);
- @media screen and (max-width: 1200px) {
+ @media screen and (width <= 1200px) {
min-width: 0;
}
@@ -177,7 +177,7 @@ html.composer-open {
@include ellipsis;
- @media screen and (max-width: 500px) {
+ @media screen and (width <= 500px) {
display: none;
}
}
diff --git a/app/assets/stylesheets/common/base/crawler_layout.scss b/app/assets/stylesheets/common/base/crawler_layout.scss
index ce701eda06c..b3bb2167931 100644
--- a/app/assets/stylesheets/common/base/crawler_layout.scss
+++ b/app/assets/stylesheets/common/base/crawler_layout.scss
@@ -144,7 +144,7 @@ body > noscript {
width: 20%;
}
- @media (max-width: 850px) {
+ @media (width <= 850px) {
table-layout: auto;
margin: 0;
diff --git a/app/assets/stylesheets/common/base/magnific-popup.scss b/app/assets/stylesheets/common/base/magnific-popup.scss
index 6bab223ea28..31e03540913 100644
--- a/app/assets/stylesheets/common/base/magnific-popup.scss
+++ b/app/assets/stylesheets/common/base/magnific-popup.scss
@@ -530,8 +530,8 @@ button {
}
@if $include-mobile-layout-for-image {
- @media all and (max-width: 800px) and (orientation: landscape),
- screen and (max-height: 300px) {
+ @media all and (width <= 800px) and (orientation: landscape),
+ screen and (height <= 300px) {
/**
* Remove all paddings around the image on small screen
*/
@@ -597,7 +597,7 @@ button {
}
// Scale navigation arrows and reduce padding from sides
-@media all and (max-width: 900px) {
+@media all and (width <= 900px) {
.mfp-arrow {
transform: scale(0.75);
}
diff --git a/app/assets/stylesheets/common/base/menu-panel.scss b/app/assets/stylesheets/common/base/menu-panel.scss
index 0aae707534c..27b12a33871 100644
--- a/app/assets/stylesheets/common/base/menu-panel.scss
+++ b/app/assets/stylesheets/common/base/menu-panel.scss
@@ -268,7 +268,7 @@
border-radius: 0;
padding: 0.857em;
- @media screen and (max-height: 400px) {
+ @media screen and (height <= 400px) {
// helps with 400% zoom level
font-size: var(--font-down-1);
padding: 0.5em 0.875em;
@@ -285,7 +285,7 @@
top: 6px;
font-size: var(--font-down-3);
- @media screen and (max-height: 400px) {
+ @media screen and (height <= 400px) {
// helps with 400% zoom level
right: 0;
top: 0;
diff --git a/app/assets/stylesheets/common/base/modal.scss b/app/assets/stylesheets/common/base/modal.scss
index 479d4a47190..29bfa7f6310 100644
--- a/app/assets/stylesheets/common/base/modal.scss
+++ b/app/assets/stylesheets/common/base/modal.scss
@@ -406,7 +406,7 @@
padding: 10px 4px 4px 4px;
}
- @media screen and (max-width: 760px) {
+ @media screen and (width <= 760px) {
.incoming-email-html-part {
width: calc(100% - 10px);
}
diff --git a/app/assets/stylesheets/common/base/not-found.scss b/app/assets/stylesheets/common/base/not-found.scss
index 3cd43a287cd..2aa5194b91a 100644
--- a/app/assets/stylesheets/common/base/not-found.scss
+++ b/app/assets/stylesheets/common/base/not-found.scss
@@ -25,7 +25,7 @@
.page-not-found-topics {
display: flex;
- @media screen and (max-width: 600px) {
+ @media screen and (width <= 600px) {
flex-wrap: wrap;
}
}
@@ -38,7 +38,7 @@
margin-bottom: 40px;
padding-right: 20px;
- @media screen and (max-width: 600px) {
+ @media screen and (width <= 600px) {
width: 100%;
}
@@ -53,7 +53,7 @@
align-items: baseline;
margin-bottom: 15px;
- @media screen and (max-width: 600px) {
+ @media screen and (width <= 600px) {
&:nth-of-type(n + 6) {
display: none;
}
diff --git a/app/assets/stylesheets/common/base/onebox.scss b/app/assets/stylesheets/common/base/onebox.scss
index 9391cbe0115..ce7ec87e703 100644
--- a/app/assets/stylesheets/common/base/onebox.scss
+++ b/app/assets/stylesheets/common/base/onebox.scss
@@ -157,7 +157,7 @@ aside.onebox {
float: left;
margin-right: 1em;
- @media all and (max-width: 600px) {
+ @media all and (width <= 600px) {
max-width: 35%;
}
diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss
index 94d9b968c98..ea1182677a3 100644
--- a/app/assets/stylesheets/common/base/topic-post.scss
+++ b/app/assets/stylesheets/common/base/topic-post.scss
@@ -754,7 +754,7 @@ aside.quote {
display: flex;
flex-wrap: wrap;
- @media screen and (max-width: 420px) {
+ @media screen and (width <= 420px) {
flex-direction: column;
align-items: flex-start;
@@ -1410,7 +1410,7 @@ span.mention {
}
}
-@media all and (max-width: 767px) {
+@media all and (width <= 767px) {
.reply-to-tab {
span {
display: none;
diff --git a/app/assets/stylesheets/common/base/topic.scss b/app/assets/stylesheets/common/base/topic.scss
index ce66b86db6c..b59162f6bf1 100644
--- a/app/assets/stylesheets/common/base/topic.scss
+++ b/app/assets/stylesheets/common/base/topic.scss
@@ -29,7 +29,7 @@
}
// timeline
- @media screen and (min-width: 925px) {
+ @media screen and (width >= 925px) {
// at 925px viewport width and above the timeline is visible (see topic-navigation.js)
.topic-navigation {
grid-area: timeline;
@@ -72,7 +72,7 @@
}
// progress bar
- @media screen and (max-width: 924px) {
+ @media screen and (width <= 924px) {
grid-template-areas: "posts";
grid-template-columns: auto;
@@ -173,7 +173,7 @@
display: flex;
flex-wrap: wrap;
- @media screen and (min-width: 925px) {
+ @media screen and (width >= 925px) {
width: 90%; // topic title isn't full-width on wide screens
}
diff --git a/app/assets/stylesheets/common/base/user-badges.scss b/app/assets/stylesheets/common/base/user-badges.scss
index c4404fdbcf2..c9bd423a11a 100644
--- a/app/assets/stylesheets/common/base/user-badges.scss
+++ b/app/assets/stylesheets/common/base/user-badges.scss
@@ -44,7 +44,7 @@
}
}
-@media all and (max-width: 750px) {
+@media all and (width <= 750px) {
.show-badge .user-badge-with-posts .badge-user a.post-link {
width: auto;
}
@@ -232,7 +232,7 @@
margin-bottom: 0.25em;
font-size: var(--font-up-1);
- @media screen and (min-width: 900px) {
+ @media screen and (width >= 900px) {
font-size: var(--font-up-2);
}
}
@@ -243,7 +243,7 @@
width: 100%;
align-self: flex-start;
- @media screen and (min-width: 767px) {
+ @media screen and (width >= 767px) {
max-width: calc(var(--d-max-width) / 2);
}
diff --git a/app/assets/stylesheets/common/base/user.scss b/app/assets/stylesheets/common/base/user.scss
index 3ba9e9b0fc9..f2994acaf97 100644
--- a/app/assets/stylesheets/common/base/user.scss
+++ b/app/assets/stylesheets/common/base/user.scss
@@ -551,7 +551,7 @@
}
}
- @media all and (max-width: 600px) {
+ @media all and (width <= 600px) {
float: none;
width: 100%;
}
diff --git a/app/assets/stylesheets/common/components/topic-map.scss b/app/assets/stylesheets/common/components/topic-map.scss
index 2e3bf362a77..349ddcf1bb3 100644
--- a/app/assets/stylesheets/common/components/topic-map.scss
+++ b/app/assets/stylesheets/common/components/topic-map.scss
@@ -48,7 +48,7 @@ body:not(.archetype-private_message) {
&.--op,
&.--bottom {
- @media screen and (max-width: 500px) {
+ @media screen and (width <= 500px) {
padding-left: 0;
}
}
@@ -251,7 +251,7 @@ body:not(.archetype-private_message) {
color: var(--primary-medium);
}
- @media screen and (max-width: 475px) {
+ @media screen and (width <= 475px) {
display: none;
}
}
diff --git a/app/assets/stylesheets/common/login/invite-signup.scss b/app/assets/stylesheets/common/login/invite-signup.scss
index 42c6cda1fcc..851833ffeaa 100644
--- a/app/assets/stylesheets/common/login/invite-signup.scss
+++ b/app/assets/stylesheets/common/login/invite-signup.scss
@@ -82,7 +82,7 @@
background: var(--secondary);
margin: 0 auto;
- @media screen and (max-width: 700px) {
+ @media screen and (width <= 700px) {
margin: 1em auto 1em auto;
padding: 1rem;
}
diff --git a/app/assets/stylesheets/common/modal/login-modal.scss b/app/assets/stylesheets/common/modal/login-modal.scss
index 95a93f9f3c4..7b39f489c9c 100644
--- a/app/assets/stylesheets/common/modal/login-modal.scss
+++ b/app/assets/stylesheets/common/modal/login-modal.scss
@@ -166,7 +166,7 @@
}
.desktop-view & {
- @media screen and (max-width: 767px) {
+ @media screen and (width <= 767px) {
// important to maintain narrow desktop widths
// for auth modals in Discourse Hub on iPad
.d-modal__header {
diff --git a/app/assets/stylesheets/common/modal/modal-overrides.scss b/app/assets/stylesheets/common/modal/modal-overrides.scss
index 83f7f0c027c..43d31ee00e5 100644
--- a/app/assets/stylesheets/common/modal/modal-overrides.scss
+++ b/app/assets/stylesheets/common/modal/modal-overrides.scss
@@ -339,7 +339,7 @@
}
}
- @media screen and (max-width: 768px) {
+ @media screen and (width <= 768px) {
.d-modal {
&__container {
width: 100%;
diff --git a/app/assets/stylesheets/common/topic-timeline.scss b/app/assets/stylesheets/common/topic-timeline.scss
index 5289df373e1..009ebaf0749 100644
--- a/app/assets/stylesheets/common/topic-timeline.scss
+++ b/app/assets/stylesheets/common/topic-timeline.scss
@@ -21,7 +21,7 @@
transition: max-height 0.4s ease-out;
}
- @media screen and (max-height: 425px) {
+ @media screen and (height <= 425px) {
max-height: 75vh;
}
@@ -56,7 +56,7 @@
transition: max-height 0.3s ease-in;
}
- @media screen and (max-height: 425px) {
+ @media screen and (height <= 425px) {
padding-top: 10px;
}
@@ -89,7 +89,7 @@
@include line-clamp(8);
- @media screen and (max-height: 425px) {
+ @media screen and (height <= 425px) {
@include line-clamp(5);
}
}
diff --git a/app/assets/stylesheets/desktop/category-list.scss b/app/assets/stylesheets/desktop/category-list.scss
index caa1c5f106b..cc7501005cf 100644
--- a/app/assets/stylesheets/desktop/category-list.scss
+++ b/app/assets/stylesheets/desktop/category-list.scss
@@ -171,15 +171,15 @@
}
div.column.categories {
- @media all and (max-width: 600px) {
+ @media all and (width <= 600px) {
margin-right: 0;
}
- @media all and (min-width: 600px) {
+ @media all and (width >= 600px) {
margin-right: 1em;
}
- @media all and (min-width: 700px) {
+ @media all and (width >= 700px) {
margin-right: 2em;
}
}
diff --git a/app/assets/stylesheets/desktop/login-signup-page.scss b/app/assets/stylesheets/desktop/login-signup-page.scss
index eb7970c1a60..dea014563a9 100644
--- a/app/assets/stylesheets/desktop/login-signup-page.scss
+++ b/app/assets/stylesheets/desktop/login-signup-page.scss
@@ -47,7 +47,7 @@
height: 100%;
}
- @media screen and (max-width: 767px) {
+ @media screen and (width <= 767px) {
// important to maintain narrow desktop widths
// for auth modals in Discourse Hub on iPad
.has-alt-auth {
diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss
index 526ee750f0b..3767626d05f 100644
--- a/app/assets/stylesheets/desktop/topic-post.scss
+++ b/app/assets/stylesheets/desktop/topic-post.scss
@@ -696,7 +696,7 @@ span.highlighted {
/* Tablet (portrait) ----------- */
-@media all and (max-width: 790px) {
+@media all and (width <= 790px) {
.topic-avatar {
width: 45px;
}
diff --git a/app/assets/stylesheets/mobile/components/user-card.scss b/app/assets/stylesheets/mobile/components/user-card.scss
index ada1b7d019d..83ae0b4edaa 100644
--- a/app/assets/stylesheets/mobile/components/user-card.scss
+++ b/app/assets/stylesheets/mobile/components/user-card.scss
@@ -108,7 +108,7 @@
max-height: 40vh;
overflow-y: auto;
- @media screen and (max-height: 550px) {
+ @media screen and (height <= 550px) {
max-height: 12vh;
}
diff --git a/app/assets/stylesheets/mobile/modal.scss b/app/assets/stylesheets/mobile/modal.scss
index 634ef03a55a..6126ec9198a 100644
--- a/app/assets/stylesheets/mobile/modal.scss
+++ b/app/assets/stylesheets/mobile/modal.scss
@@ -84,7 +84,7 @@ html:not(.keyboard-visible.mobile-view) {
font-size: var(--font-up-4);
}
-@media only screen and (max-device-width: 568px) {
+@media only screen and (device-width <= 568px) {
.flag-modal-body .flag-message {
height: 3em;
}
diff --git a/app/assets/stylesheets/mobile/topic-post.scss b/app/assets/stylesheets/mobile/topic-post.scss
index c2f742a442d..9d36a68eac7 100644
--- a/app/assets/stylesheets/mobile/topic-post.scss
+++ b/app/assets/stylesheets/mobile/topic-post.scss
@@ -127,7 +127,7 @@ nav.post-controls button.reply .d-icon {
bottom: -50px;
left: 135px;
- @media screen and (max-width: 374px) {
+ @media screen and (width <= 374px) {
left: 50px;
}
}
diff --git a/app/assets/stylesheets/wizard.scss b/app/assets/stylesheets/wizard.scss
index f03c3b79543..a57bf14c5e8 100644
--- a/app/assets/stylesheets/wizard.scss
+++ b/app/assets/stylesheets/wizard.scss
@@ -58,7 +58,7 @@ body.wizard {
height: 50px;
}
- @media screen and (max-height: 900px) {
+ @media screen and (height <= 900px) {
.desktop-view & {
display: none;
}
@@ -185,7 +185,7 @@ body.wizard {
&__field.text-governing-law,
&__field.text-city-for-disputes {
- @media only screen and (max-width: 568px) {
+ @media only screen and (width <= 568px) {
display: none;
}
}
@@ -200,7 +200,7 @@ body.wizard {
display: flex;
flex: 1 0 50%;
- @media only screen and (max-width: 568px) {
+ @media only screen and (width <= 568px) {
width: 100%;
}
}
@@ -210,7 +210,7 @@ body.wizard {
box-sizing: border-box;
margin-right: 1em;
- @media only screen and (max-width: 925px) {
+ @media only screen and (width <= 925px) {
width: 100%;
margin-left: auto;
margin-right: auto;
@@ -223,7 +223,7 @@ body.wizard {
border-radius: 0.5em;
margin-top: -1em;
- @media only screen and (max-width: 925px) {
+ @media only screen and (width <= 925px) {
display: none;
}
}
@@ -348,7 +348,7 @@ body.wizard {
&__step-text {
display: inline;
- @media only screen and (max-width: 568px) {
+ @media only screen and (width <= 568px) {
display: none;
}
}
@@ -558,7 +558,7 @@ body.wizard {
margin: 0;
}
- @media only screen and (max-width: 568px) {
+ @media only screen and (width <= 568px) {
font-size: var(--font-0);
}
}
@@ -568,7 +568,7 @@ body.wizard {
font-size: var(--font-up-1);
margin: 0.25em 0 0.5em 3.5em;
- @media only screen and (max-width: 568px) {
+ @media only screen and (width <= 568px) {
margin-left: 2em;
}
}
@@ -630,7 +630,7 @@ body.wizard {
vertical-align: middle;
transition: background 0.25s;
- @media only screen and (max-width: 568px) {
+ @media only screen and (width <= 568px) {
height: 20px;
width: 35px;
}
@@ -649,7 +649,7 @@ body.wizard {
top: 4px;
left: 9px;
- @media only screen and (max-width: 568px) {
+ @media only screen and (width <= 568px) {
top: 3px;
left: 5px;
font-size: var(--font-down-3);
@@ -665,7 +665,7 @@ body.wizard {
left: 4px;
transition: left 0.25s;
- @media only screen and (max-width: 568px) {
+ @media only screen and (width <= 568px) {
height: 12px;
width: 12px;
}
@@ -685,7 +685,7 @@ body.wizard {
&__checkbox:checked + .wizard-container__checkbox-slider::before {
left: 26px;
- @media only screen and (max-width: 568px) {
+ @media only screen and (width <= 568px) {
left: 20px;
}
}
@@ -766,7 +766,7 @@ body.wizard {
display: flex;
gap: 1em;
- @media screen and (max-width: 750px) {
+ @media screen and (width <= 750px) {
flex-direction: column-reverse;
}
}
diff --git a/lib/stylesheet/manager.rb b/lib/stylesheet/manager.rb
index b43068eab92..c3eda00f156 100644
--- a/lib/stylesheet/manager.rb
+++ b/lib/stylesheet/manager.rb
@@ -8,7 +8,7 @@ end
class Stylesheet::Manager
# Bump this number to invalidate all stylesheet caches (e.g. if you change something inside the compiler)
- BASE_COMPILER_VERSION = 3
+ BASE_COMPILER_VERSION = 4
# Add any dependencies here which should automatically cause a global cache invalidation.
BASE_CACHE_KEY = "#{BASE_COMPILER_VERSION}::#{DiscourseFonts::VERSION}"
diff --git a/plugins/discourse-presence/assets/stylesheets/presence.scss b/plugins/discourse-presence/assets/stylesheets/presence.scss
index c95a97bd754..45c8a706d74 100644
--- a/plugins/discourse-presence/assets/stylesheets/presence.scss
+++ b/plugins/discourse-presence/assets/stylesheets/presence.scss
@@ -75,7 +75,7 @@
// When topic progress is visible in the posts grid area and is sticky,
// adjust positioning so presence is on the same line
-@media screen and (max-width: 924px) {
+@media screen and (width <= 924px) {
body:has(.topic-navigation.with-topic-progress)
.topic-above-footer-buttons-outlet.presence {
margin-top: -3.2em;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c338aacc3fe..ca8571ffe4c 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1066,6 +1066,9 @@ importers:
postcss-js:
specifier: ^4.0.1
version: 4.0.1([email protected])
+ postcss-media-minmax:
+ specifier: ^5.0.0
+ version: 5.0.0([email protected])
source-map-js:
specifier: ^1.2.1
version: 1.2.1
@@ -7023,6 +7026,12 @@ packages:
peerDependencies:
postcss: ^8.4.21
+ resolution: {integrity: sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ==}
+ engines: {node: '>=10.0.0'}
+ peerDependencies:
+ postcss: ^8.1.0
+
resolution: {integrity: sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig==}
@@ -16247,6 +16256,10 @@ snapshots:
camelcase-css: 2.0.1
postcss: 8.5.3
+ dependencies:
+ postcss: 8.5.3
+
diff --git a/stylelint.config.mjs b/stylelint.config.mjs
index 990ebbd1c9d..f0e759cf567 100644
--- a/stylelint.config.mjs
+++ b/stylelint.config.mjs
@@ -1,3 +1,6 @@
export default {
extends: ["@discourse/lint-configs/stylelint"],
+ rules: {
+ "media-feature-range-notation": "context",
+ },
};