DEV Community

Discussion on: CSS: bad parts

Collapse
 
giorgosk profile image
Giorgos Kontopoulos 👀

Margins are inevitable though, can not do FE without them but need to have clear rules of which components can use them and keep consistent within an application.

For example all sub-component should generally avoid having OUTER margins and leave that to the parent or container component(s) to decide by way of padding perhaps. A sub-component should be allowed to define its own internal margins/padding (between its own elements) only.

Collapse
 
stereobooster profile image
stereobooster

You can refuse from margins, for example use grid and gap properties, or "spacer" component, or flexbox. (Padding allowed though)

Collapse
 
giorgosk profile image
Giorgos Kontopoulos 👀 • Edited

Grid not fully supported on IE 11 so not always possible to use grid ... Many webshops still support this browser. :)

Thread Thread
 
stereobooster profile image
stereobooster • Edited

According to Microsoft, IE11 is supported until the end of Windows 10 which is on October 14, 2025

I guess we can wait a bit :-) Or maybe use some kind of polyfill/transpiler, like this one.