oblique-bit / oblique

An Angular front-end framework Tailored for your swiss branded business web application, Oblique provides a standardized corporate design look and feel as well as a collection of ready-to-use Angular components. Oblique, through its fully customizable master layout, takes care of the application's structure, letting you focus on the content.
https://oblique.bit.admin.ch
MIT License
56 stars 13 forks source link

stop using margins on components #149

Open mumenthalers opened 3 days ago

mumenthalers commented 3 days ago

You should stop defining any margins on component host elements - I consider this bad practice. It makes it pretty annoying to use such components in different context, e.g. in a column-flex layout together with gap.

https://github.com/oblique-bit/oblique/blob/7be37c820b2fafd64f041a8bdfea2817be6c7b01/projects/oblique/src/lib/alert/alert.component.scss#L4-L6

margins (as gaps) should always be applied from the outer scope; the one that defines the layout where the component is used.

on top - in this specific case - it is strong selector so I need to either use !important, the style attribute or a 3 classes selector...