Media queries
All platforms
2.0.0
Media queries provide more power and allow you to style cross-platform apps with pixel-perfect accuracy.
Basic usage
To use media queries, you need to import the mq
utility and convert your value to an object
:
The mq
utility provides Intellisense for quickly building your media queries.
Advanced usage
You can also combine width
media queries with height
media queries:
Or use only height
media queries:
You can also reuse your defined breakpoints:
Reference
You can mix media queries with breakpoints, but media queries will always have higher priority:
CSS Media Queries support is only available on the web.
To use CSS Media Queries set experimentalCSSMediaQueries
with UnistylesRegistry
:
With experimentalCSSMediaQueries
set to false
, Unsityles will compute your styles in the JavaScript.