Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Media Queries Out Of Order #975

Open
SCasarotto opened this issue Mar 1, 2018 · 6 comments
Open

Media Queries Out Of Order #975

SCasarotto opened this issue Mar 1, 2018 · 6 comments

Comments

@SCasarotto
Copy link

screen shot 2018-03-01 at 8 16 30 am

screen shot 2018-03-01 at 8 16 24 am

Most of the time this isn't an issue but I found that the media queries are getting created out of order. Is this something I am doing wrong or is this possibly something with the library?

@SCasarotto
Copy link
Author

I would love if someone could explain to me how this works. The only different I changed was the value in the fontSize from 30 to 32 and when it is 32 it is in the right order but not when its 30. See below:
screen shot 2018-03-10 at 2 00 35 pm
screen shot 2018-03-10 at 2 00 25 pm
screen shot 2018-03-10 at 2 01 06 pm
screen shot 2018-03-10 at 2 01 02 pm

@SCasarotto
Copy link
Author

It looks like this is caused because Radium will reuse media queries on multiple stops. Because of this, the order doesn't match the js stylesheet. If anyone else runs into this, hope that helps.

@ryan-roemer
Copy link
Member

@SCasarotto -- do you think you could open a WIP pull request that just adds failing regression test(s)?

@SCasarotto
Copy link
Author

@ryan-roemer I am not sure when I will get a chance to setting that up. I could provide an example on codesandbox if that would help.

@stevenmusumeche stevenmusumeche self-assigned this Oct 2, 2018
@stevenmusumeche
Copy link
Contributor

@SCasarotto I'm unable to reproduce this. An example codesandbox or WIP pull request that adds failing regression tests would allow us to fix this issue.

@stevenmusumeche stevenmusumeche removed their assignment Oct 4, 2018
@SCasarotto
Copy link
Author

Sorry this has taken so long to come back to. Work has been crazy and I hadn't worked on a project where this was a problem in a while.

https://codesandbox.io/s/5vrvy139xn

If you remove line 15 in styles.js all styles are applied the same to all. When its added the order gets all messed up. There are probably many ways to recreate this but that seems to be clearest.

Notice the difference applied to each.

image

@rawrmonstar rawrmonstar self-assigned this Dec 19, 2018
@rawrmonstar rawrmonstar removed their assignment Dec 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants