-
Notifications
You must be signed in to change notification settings - Fork 67
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
Order Media Queries #1567
Comments
I realised that this approach only works if stylesheet extraction is enabled, as it needs to sort the entire sheet at once. |
Mm I think style groups are still ordered when ran in runtime mode. Let me look. Edit: https://github.com/atlassian-labs/compiled/blob/master/packages/react/src/runtime/sheet.ts |
Yea, but I think ordering the breakpoints on client-side is going to be quite a runtime cost. |
True. |
I can think of two options: Option 1: Ask the users of Compiled to avoid overlapping breaking points
Option 2: Sort the media query by break points somehow. I will take a look how Stylex does it. |
Compiled uses Atomic CSS, so the order of CSS rules is not based on the definition in the codebase.
This means
in the ☝️, the order of these two pieces of CSS rules are not guaranteed.
Can we order the Media Query CSS, so they are always mobile first?
Implementation detail:
Create a postcss plugin to sort media queries.
The text was updated successfully, but these errors were encountered: