Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: DP aware breakpoints/media queries for mobile #517

Closed
jpudysz opened this issue Jan 22, 2025 · 0 comments
Closed

RFC: DP aware breakpoints/media queries for mobile #517

jpudysz opened this issue Jan 22, 2025 · 0 comments
Milestone

Comments

@jpudysz
Copy link
Owner

jpudysz commented Jan 22, 2025

Description

Currently, using breakpoints or media queries on mobile returns values in pixels (not in points, meaning the scale factor is ignored).

This behavior can be convenient in cases where you only use media queries for browsers and don't need breakpoints on mobile.

Based on this discussion: #395
we plan to introduce a setting that allows using points instead of pixels on mobile.

I'm still unsure if this should be enabled by default.

Example configuration:

Stylesheet.create({
    // other configs
    settings: {
        nativeBreakpointsMode: 'points'  // defaults to 'pixels'
    }
})

This will only affect mq and breakpoints, while the web logic will remain unchanged.

Steps to Reproduce

Snack or Repository Link (Optional)

No response

Unistyles Version

3.0.0-beta.5

React Native Version

0.76.5

Platforms

Web, iOS, Android

Expo

None

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

No branches or pull requests

1 participant