openeuropa / bootstrap-component-library

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

Content banner card margin change #517

Closed kp77 closed 1 month ago

kp77 commented 1 year ago

There is a rule in _banner.scss that defines horizontal margins for the .card inside a .bcl-content-banner. This rule doesn't seem to apply in the BCL examples, as the content banner doesn't have a .container outer element, for example see the event page feature.

However, in our project, we have an outer .container wrapper in this case, and the rule applies. After updating to BCL 1.0.0, the previously correct image spacing in the content banner has changed, and the left edge of the image moved outside the sitewide container. See screenshot:

Screenshot 2023-03-13 at 17 09 54

I found that the $container-padding-x variable used to define the margins for the card was changed in Bootstrap compared to the previous version we used. The value of the variable is now doubled compared to the previous Bootstrap version. Adding the following override in our theme's css (that sets the value to the previously used) fixed the alignement issue for us:

@include media-breakpoint-up(md) {
  .container {
    .bcl-content-banner {
      .card {
        margin-right: -$container-padding-x * .5;
        margin-left: -$container-padding-x * .5;
      }
    }
  }
}
kp77 commented 1 year ago

Some update on this: we had some incorrect overrides in our css due to imports that we had to fix, and that changed the situation with this issue. We still have the issue, but instead of the fix posted previously, we need to set the margins to 0 instead of -$container-padding-x * .5.

So for us it seems the solution would be if this rule would be removed from BCL altogether, as 0 left/right margin is the default value on the element.

kp77 commented 9 months ago

Update: the issue with the horizontal spacing is fixed after updating to BCL 1.2.0.