The other day, a friend asked for help debugging some CSS in a side project he was helping out with. A complicated piece of UI was busted.
Turns out, a component he was using had been updated, and now had a few internal divs for utility flex styling that blew up his own layout.
#webdev #html #css
Turns out, a component he was using had been updated, and now had a few internal divs for utility flex styling that blew up his own layout.
#webdev #html #css
Comments
1. Be careful updating the markup of shared components. Adding markup can wreck someone else's selectors that expect a particular pattern.
Ideally, you bump your library's major version. But if that isn't feasible, or you're not using a library, make sure to test your use cases.
Flexbox is awesome, but understanding its limits and where, when and how to use CSS grid is part of the job. Play a round of code golf and get rid of some extra markup.
Solutions I've seen in the past seem fiddly and require a paid subscription somewhere.