Better Resize Observer API
New article just dropped on CSS Tricks 😉.
This one is about improving the Resize Observer API so it becomes much easier to use.
So you go from this:
To this:
Hope you have fun reading through this one.
I have one more article on improving the Mutation Observer and Intersection Observer in the same style coming up next week 🙂.
Stay awesome,
Zell
P.S. You can use the resizeObserver utility from Splendid Labz if you don’t wanna go through the refactoring steps yourself. More info about how to access & purchase the library will come soon. In the meantime, use the instructions I’ve included in the CSS Tricks article to use it for free.