Stop Resizing
Your Browser Window 🛑
Improve testing for responsiveness ✨
Jen Chan. JS Lightning Talk 2024-04-30
whoami 😱
Browser resizing won’t account for 👇🏻
1:4
2 DPR
1:1
1 DPR
@media screen and (min-width: 320px)
and (max-width: 600px) and (orientation: portrait) {
…
}
Device resolution
750 x 1336px
CSS pixels
375 x 667px
326ppi
DPR: 2
2x density
⚠️ Reflow and re-renders
❌
Resizing in responsive mode?
Inadequate for components with listeners
Example: Wayfair’s Bed and Bath Category Page
Device Specs:
Macbook M2
Resolution: 3024 x 1964
Chrome 124.0.6367.62
Device Pixel Ratio: 2
<meta name="viewport" content="width=device-width, initial-scale=1">
Device Mode on Chrome Devtools
Even more convenient… Responsively
Automate visual regression testing
(if your company will let you)
Thank you 👏
No more 🙅🏻♀️
🕊️
❌
🗑️