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

Max Width Media Query #1904

Closed
tpreusse opened this issue Jul 1, 2022 · 3 comments · Fixed by #1910
Closed

Max Width Media Query #1904

tpreusse opened this issue Jul 1, 2022 · 3 comments · Fixed by #1910

Comments

@tpreusse
Copy link

tpreusse commented Jul 1, 2022

Describe the bug

Starting with v2.1.2 (max-width) media queries seem not to work any more. For our A5 PDF we use the following which is no longer applied:

const styles = StyleSheet.create({
  center: {
    paddingHorizontal: 90,
    '@media max-width: 420': {
      paddingHorizontal: 0
    }
  }
})

Screenshot 2022-07-01 at 11 32 32

To Reproduce

  1. Use a max-width: 420 media query with page size A5
  2. Visually verify that it is not applied

REPL Example

Expected behavior

The max-width media query should take effect and modify the applied style.

Desktop:

  • OS: macOS
  • React-pdf version: 2.1.2 and 2.2.0
@diegomura
Copy link
Owner

Thanks for reporting this @tpreusse ! So good to see your name around 😄
Also very glad to see you are using v2. How did it work for you. Last time we talk I think you were on v1

@tpreusse
Copy link
Author

tpreusse commented Jul 4, 2022

Thank you for the quick fix 🎉

We upgraded last summer and went quite smoothly. Let's catch up soon.

@diegomura
Copy link
Owner

Glad to hear that @tpreusse !!
Yes please! Let's catch up soon

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 a pull request may close this issue.

2 participants