Skip to content

Add remaining preference media queries - #288

Closed
lukewarlow wants to merge 15 commits into
servo:mainfrom
lukewarlow:preference-mqs
Closed

lukewarlow wants to merge 15 commits into
servo:mainfrom
lukewarlow:preference-mqs

Conversation

@lukewarlow

Copy link
Copy Markdown
Member

This adds prefers-contrast, prefers-reduced-motion, and prefers-reduced-transparency.

Servo PR: servo/servo#42011

delan and others added 9 commits June 5, 2026 19:26
Any ancestors of this commit are from upstream mozilla-central, with
some filtering and renaming. Our patches and sync tooling start here.

The sync tooling has all been squashed into this commit, based on:
https://github.com/servo/stylo/commits/64731e10dc8ef87ef52aa2fb9f988c3b2530f3a7
This is a rebase of 2453c41

Signed-off-by: Oriol Brufau <[email protected]>
The unit of (1 / 2px) is definitely not a px. Right now we disallow
dividing by non-numbers, so enforce it.

Once we implement unit math we could start tracking exponents (and
support something like squared pixels etc).

Differential Revision: https://phabricator.services.mozilla.com/D304694
@jdm

jdm commented Jun 14, 2026

Copy link
Copy Markdown
Member

We should rebase this change against the latest main branch and merge it.

Loirooriol and others added 5 commits June 15, 2026 08:25
We were previously using a mix of f32 and f64. Then it could happen that
we would first check that `a < b` in f64, but when converting to f32,
they might become equal due to the precision loss. Thus this could break
invariants in the logic, making a `debug_unreachable!()` reachable.

Servo PR: servo/servo#45682

Signed-off-by: Oriol Brufau <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
Reverts servo#368

More work is required in Servo to integrate this.
Fixes servo#390

This feature is quite impactful as it is required for Tailwind's hover
styles to work.

Servo PR: servo/servo#45681

Signed-off-by: Nico Burns <[email protected]>
…servo#388)

It's not possible to properly calculate these only looking at style,
because the results depends on the used `overflow` value.

Servo PR: servo/servo#45629

Signed-off-by: Martin Robinson <[email protected]>
This adds `prefers-contrast`, `prefers-reduced-motion`, and `prefers-reduced-transparency`.

Signed-off-by: Luke Warlow <[email protected]>
@lukewarlow

Copy link
Copy Markdown
Member Author

Fingers crossed this is rebased correctly.

@nicoburns nicoburns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase looks good to me :)
(but I'll hold off on merging until the Servo PR is updated and green)

@Loirooriol
Loirooriol force-pushed the main branch 2 times, most recently from c65e829 to 9ee9ec6 Compare September 10, 2026 12:56
staging-devin-ai-integration Bot pushed a commit to DioxusLabs/stylo that referenced this pull request Nov 20, 2026
This adds `prefers-contrast`, `prefers-reduced-motion`, and
`prefers-reduced-transparency`.

Rebased and updated version of servo#288

Supersedes and closes servo#288

Servo PR: servo/servo#50095

Signed-off-by: Tim van der Lippe <[email protected]>
Co-authored-by: Luke Warlow <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants