Skip to content

fix: mediaquery matching on defineVars - #534

Open
axyz wants to merge 1 commit into
react:mainfrom
axyz:fix/mediaquery-in-definevars
Open

axyz wants to merge 1 commit into
react:mainfrom
axyz:fix/mediaquery-in-definevars

Conversation

@axyz

@axyz axyz commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #283

On native, width media queries work in css.create but are ignored in css.defineVars. In dark mode, a token without a dark override also loses its default.

This PR reuses the native media matcher for variables and theme overrides, so tokens update when the window size changes and keep their default when no query matches. Web output is unchanged.

@meta-cla meta-cla Bot added the cla signed label Nov 24, 2026
@github-actions

Copy link
Copy Markdown

workflow: benchmarks/size

Comparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.

Results Base Patch Ratio
react-strict-dom/dist/web/index.js
· compressed 3,251 3,251 1.00
· minified 10,375 10,375 1.00
react-strict-dom/dist/web/runtime.js
· compressed 1,645 1,645 1.00
· minified 4,131 4,131 1.00
react-strict-dom/dist/native/index.js
· compressed 16,827 16,951 1.01 +
· minified 65,415 65,911 1.01 +
react-strict-animated/dist/web/index.js
· compressed 6,861 6,861 1.00
· minified 23,486 23,486 1.00
react-strict-animated/dist/native/index.js
· compressed 797 797 1.00
· minified 2,518 2,518 1.00

@github-actions

Copy link
Copy Markdown

workflow: benchmarks/perf (native)

Comparison of performance test results, measured in operations per second. Larger is better.

Results Base Patch Ratio
css.create
· small 1,511,754 1,521,245 1.01 +
· small with units 663,419 637,173 0.96 -
· small with variables 894,335 883,392 0.99 -
· several small 476,517 464,270 0.97 -
· large 273,460 264,914 0.97 -
· large with polyfills 204,300 199,422 0.98 -
· complex 142,919 138,175 0.97 -
· unsupported 278,618 275,177 0.99 -
css.createTheme
· simple theme 319,689 322,769 1.01 +
· polyfill theme 298,484 299,744 1.00 +

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mediaquery not working in defineVars on real devices

1 participant