-
Notifications
You must be signed in to change notification settings - Fork 107
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
Updates media query generator function to use CSS range syntax #1833
base: trunk
Are you sure you want to change the base?
Updates media query generator function to use CSS range syntax #1833
Conversation
Here's a script you can use to update the snapshots once the #!/bin/bash
for actual in $( find . -name 'actual.html' ); do
expected=${actual/actual/expected};
echo "$actual => $expected"
mv "$actual" "$expected"
done There should probably be something like this added to |
Hello @westonruter I didn't get your above message. Is this for updating PHP unit tests ? |
Yes, the unit test failures are due to the HTML snapshots being out for date now that the media query is updated. So you need to move all the |
@@ -34,27 +34,27 @@ public function data_to_test_od_generate_media_query(): array { | |||
'mobile' => array( | |||
'min_width' => 0, | |||
'max_width' => 320, | |||
'expected' => '(max-width: 320px)', | |||
'expected' => null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this null? It should be unchanged.
), | ||
'mobile_alt' => array( | ||
'min_width' => null, | ||
'max_width' => 320, | ||
'expected' => '(max-width: 320px)', | ||
'expected' => null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same. This should be unchanged, right?
'expected' => '(min-width: 601px)', | ||
'expected' => null, | ||
), | ||
'desktop_alt' => array( | ||
'min_width' => 601, | ||
'max_width' => null, | ||
'expected' => '(min-width: 601px)', | ||
'expected' => null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
Co-authored-by: Weston Ruter <[email protected]>
Summary
Fixes #1696
Relevant technical choices
Using CSS range syntax helps eliminate frontend issues where windows are sized sub-pixel dimensions.
This converts media queries from
to
The above conversion results in eliminating sub-pixel dimension issues possible between 600px to 601px screen.