#matchMedia
4/ 3️⃣ Use React Libraries for Responsiveness
Libraries like react-responsive provide React-friendly APIs for breakpoints.

💡 No need to handle matchMedia manually.
🛠️ Ideal for React-heavy projects.

But requires adding another dependency.
December 4, 2024 at 11:47 AM
www.bitcoinbeach.com (in El Zonte) erklärt den Menschen mit Hilfe von Bitcoin das Finanzsystem ;-) "Das Bitcoin Experiment" - youtu.be/v-hG3rkAjhg #Doku #Dokumentation #ElSalvador
"Das Bitcoin Experiment" Kurzdoku
YouTube video by MatchMedia
youtu.be
November 21, 2024 at 8:58 PM
very useful article on MDN about using the #matchMedia API http://t.co/E2ubRQyq7c
September 26, 2013 at 6:00 AM
Image Transitions Between Sections on Scroll with GSAP

✨ It includes:
• Built with GSAP Flip & ScrollTrigger
• Responsive design with GSAP matchMedia
• Flip animation on desktop & tablet
• Static layout on smaller screens

#GSAP #ScrollTrigger #Flip

🎬 youtu.be/-LE3aUVU608
October 7, 2025 at 4:47 PM
The homepage video could conditionally apply the autoplay and loop attributes based on JS matchMedia/prefers-reduced-motion and an onscreen play/pause button. web.dev/articles/pre...
prefers-reduced-motion: Sometimes less movement is more  |  Articles  |  web.dev
The prefers-reduced-motion media query detects whether the user has requested that the system minimize the amount of animation or motion it uses. This is for users who either require or prefer minimiz...
web.dev
June 2, 2026 at 5:36 AM
three if you SSR, since you need an explicit 'system' state to avoid a flash before prefers-color-scheme resolves client-side. two is fine for pure client-rendered, just read matchMedia once. syncing multiple open tabs when the OS setting flips mid-session is the annoying part either way.
August 4, 2026 at 1:50 PM
Anyway Chrome now reports `matchMedia('(color-gamut:p3)').matches === true`. That was the whole point of this extra expense and effort. And maybe for gaming.

(Firefox can't do HDR yet 🥺)
December 29, 2025 at 3:43 PM
Client had a project video they wanted visitors to see immediately.

Built it so the video takes over the full screen on page load, then transitions smoothly into the hero section. GSAP for the animation, matchMedia to handle mobile.

Clean way to give the video attention.

#WebflowDevelopment #GSAP
February 11, 2026 at 9:46 AM
Mostly wrapping other event emitting APIs, like matchMedia (now built in) and fullscreenchange.
December 8, 2024 at 6:07 AM
You either put selectors inside media queries (see www.smashingmagazine.com/2024/03/sett...) or you control everything from JS as single source of truth by using `matchMedia('(prefers-color-scheme: light)')` for the initial value + listen to its `change` event for updates.
Setting And Persisting Color Scheme Preferences With CSS And A “Touch” Of JavaScript — Smashing Magazine
There are many ways to approach a “Dark Mode” feature that respects a user’s system color scheme preferences and allows for per-site customization. Henry Bley-Vroman walks through a new possibility th...
www.smashingmagazine.com
December 25, 2024 at 3:34 PM
It felt so awesome to have this level of control over the styling in different experiences without needing to write a verbose JS approach.

I did use the matchMedia API because I wanted to render a completely separate component for results on mobile, but still

developer.mozilla.org/en-US/docs/W...
April 2, 2025 at 3:02 PM
text scramblin' on :hover/:focus-visible

~20 LoC including a matchMedia check 🤙
November 5, 2024 at 11:19 AM
ontem passei umas 3h entendendo o matchMedia e aplicando uma store pra pegar os tamanhos de tela e tal pra descobrir que o svelte já tinha essa função dentro dele
March 18, 2025 at 12:14 PM
You can use the `matchMedia` JavaScript method to check your user's color scheme preferences.

It is very useful when you want to give your user to change his theme only on your website.

`matchMedia` can also be used for every media query you want.

#techtweets #day75
April 29, 2025 at 6:17 PM
Today I came across the usecase where I needed a `matchMedia()` for CSS container queries.
The API doesn't exist but it seems like it will in the future: github.com/w3c/csswg-dr...
There is even a super light polyfill!
github.com/teetotum/mat...
[css-contain] Similar to window.matchMedia(), Container Queries should have a similar method · Issue #6205 · w3c/csswg-drafts
CSS Media Queries have a method on the Window interface (window.matchMedia()) giving a script the ability to listen for media query changes. I propose that CSS Container Queries has the same functi...
github.com
May 21, 2025 at 7:00 AM
Aproveitando a rede nova para reciclar conteúdo:

Poucos dinossauros sabem, mas também dá para usar as media queries com a API matchMedia do próprio Javascript:

Isso é útil quando esconder a renderização de algum componente é mais benéfico do que esconder ele só com CSS

cc @sseraphini.bsky.social
September 3, 2024 at 1:15 PM
Webサイトの作りによっては、CSSのみでの実装が難しい場合もあり、JavaScriptが必要になってくる。

matchMediaメソッドはかなり使える。

【JavaScriptでダークモードやライトモードのテーマカラーを判別する】
blanche-toile.com/web/javascri...

#Webdev #JavaScript
JavaScriptでダークモードやライトモードのテーマカラーを判別する | Webエンジニアのブログ
Web制作では、必要に応じてテーマカラーに合わせてWebデザインを作っていくこともありますが、Webサイトの作りによっては、JavaScriptでダークモードとライトモードの切り替えを行う必要も出てきます。JavaScriptではmatchMediaメソッドを使うことで、テーマカラーの判別を行うことができます。
blanche-toile.com
June 24, 2025 at 7:12 AM
er alveg út að tékka bara system settings?

t.d. í browser / js:

window?.matchMedia?.("(prefers-color-scheme:dark)")?.matches ? "dark" : "light"

eða browser / css:

@media (prefers-color-scheme: dark)
November 20, 2023 at 8:52 PM
Specifically, for anyone wondering:
- addEventListener on matchMedia queries is not supported on mobile safari - only desktop (the non-standard addListener works though)
- The MediaSource api for video sources isn't supported on mobile safari - only desktop.
December 4, 2024 at 5:57 PM
For anyone using my responsive-video web component (which extends built-in video), just a note that I made several improvements recently, many of which make it work better in iOS, as that version of Safari is missing a bunch of little video and matchMedia API features scottjehl.com/posts/even-r...
Extending Responsive Video with HTML Web Components | Scott Jehl, Web Designer/Developer
Using web components to defensively polyfill some more responsive behavior
scottjehl.com
December 4, 2024 at 5:40 PM