DEV Community

Discussion on: Never make your text container a flexbox container

Collapse
 
wintercounter profile image
Victor Vincent

I'm usually using a flex reset. Usually you need flex more times than block, so at the end it's easier to set block/inline where needed. Not to mention that using flex actually can have better render performance in some cases.

Collapse
 
mamlukishay profile image
Ishay Mamluk

Interesting idea 🔥

Collapse
 
wintercounter profile image
Victor Vincent

It has a major drawback. Using reset the classic way like div, article, section, etc {...} It'll conflict with 3rd party libs. I'm doing this in a React environment where no HTML elements are used in JSX, instead there's a unified component for all that's markup and style, so I can simply set a default for these components. I believe if the web would be introduced today or it'd allow braking changes, flex would be the default.

Collapse
 
afif profile image
Temani Afif

setting flex everywhere by default is worse than what I described in this post ...

Collapse
 
wintercounter profile image
Victor Vincent • Edited

Works well for me, it helps me avoid many side-effects and cross-browser compatibility issues. Using the other way I ended up applying flex to 80% of my elements, which is really annoying.

Thread Thread
 
afif profile image
Temani Afif

Works well for me --> until now ;)

Thread Thread
 
wintercounter profile image
Victor Vincent

No, worked well for the last 3 years for all my projects. Familiar with React Native's View component? It's basically the same methodology.

Some comments have been hidden by the post's author - find out more