#39068·servo

Tracking issue: media queries (css `@media(...)`)

Author: nicoburnsCreated Sep 1, 2025Updated Sep 17, 2026
LabelsE-less-complexB-feature-trackingA-stylo

Media queries are a very useful feature. Servo has support for the syntax and a general framework for implementing them through Stylo. And it supports a few of the most common query types. However there are a large number of media queries that we don't support.

Spec: https://www.w3.org/TR/mediaqueries-5/ MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Using_media_queries

We have a bug report on Blitz that @media(hover: hover) is required for tailwind: https://github.com/DioxusLabs/blitz/issues/252

List of media queries

This is a list of all of the media query types supported by Gecko. The ones supported by Servo are ticked.

Implementation hints

Our general stratagy thus-far has been to pass data into Stylo via the Device

See these PRs implementing the prefers-color-scheme media query: