openeuropa / bootstrap-component-library

Openeuropa Bootstrap Component Library
https://oelibrary.netlify.app/
MIT License
15 stars 9 forks source link

[do not merge] OEL-1500: Vertical margins proof-of-concept. #429

Closed donquixote closed 1 year ago

donquixote commented 2 years ago

Proof-of-concept solution for vertical margins.

Goals

Strategy

Scope

I have more changes locally, but I want to limit the scope for now.

Comparison to other PR

There was an alternative PR #363 by @planctus, with a similar goal. So what are the similarities and differences?

This PR (#429) Other PR (#363)
section concept introduces "sections". One level of <section> tags introduces "sections" concept. Two levels: bcl-section, bcl-section-group
classes and css for margins uses existing bootstrap utility classes for margins introduces new bcl-section and bcl-section-group classes for margins
disable margin of first/last child new eat-margin utility classes to control first and last element margin. Direct child selector (>) prevents undesired side effect on nested child elements. contextual CSS with :first-parent, :last-parent and similar to control first and last element margin. Direct child selector (>) used for some rules, but not all -> side effects on nested children are possible.
margin-top or margin-bottom? margin-bottom as starting point, following common approach from bootstrap 5. margin-top for section elements
local or global? solution can be applied locally and piecemeal solution should be applied to a larger part of the page for the desired outcome. E.g. we also have to add the classes in the sidebar.
strategy or solution? overall more like a "strategy" for how to apply existing solutions, rather than a completely new solution. new solution to replace existing classes.

TBD