kirbydesign / designsystem

Kirby Design System
https://cookbook.kirby.design
MIT License
84 stars 22 forks source link

[BUG] kirby-x-banner-image content not properly shown on desktop #3590

Closed RasmusKjeldgaard closed 2 weeks ago

RasmusKjeldgaard commented 2 weeks ago

Describe the bug

If I package the @kirbydesign/extensions-angular and install it in a fresh Angular 17 project,

Describe how to reproduce the bug

  1. From the root of our repo, run npx nx build extensions-angular && npm pack libs/extensions/angular/dist
  2. In a fresh Angular 17 project, install the produced tgz file, e.g. add the tgz file to the root of the fresh application and add "@kirbydesign/extensions-angular": "file:kirbydesign-extensions-angular-0.0.1.tgz", to dependencies in package.json
  3. Import ImageBannerComponent and add it to your template
    <kirby-x-image-banner
    [title]="'An Image Banner'"
    [imagePath]="'https://images.unsplash.com/photo-1514415008039-efa173293080'"
    [bodyText]="'This is the body text.'"
    [actionButtonText]="'Read more'"
    [backgroundBlur]="'dark'"
    ></kirby-x-image-banner>
  4. Content inside the banner is clipped when viewport width is above the small breakpoint (632px): image

Which Kirby version was used?

Unreleased extensions-angular library.

What was the expected behavior?

I would expect all content to show like this:

image

Checklist:

The following tasks should be carried out in sequence in order to follow the process of contributing correctly.

Verification

To make sure the bug is not intended behaviour; it should be verified by a member of team Kirby before moving on to implementation.

Implementation

The contributor who wants to implement this issue should:

Review

Once the issue has been implemented and is ready for review:

RasmusKjeldgaard commented 2 weeks ago

The issue can be "fixed" by applying something like height: 100% to .content-layer inside kirby-card, as its height is currently 0:

image

So the content layer is collapsing as the height of the content inside is 0, and we should probably fix this by letting the height of the banner be defined by the elements inside the nested kirby-card, not by setting a fixed height directly on the kirby-card element.

RasmusKjeldgaard commented 2 weeks ago

Turns out the 100% height fix was applied in #3492, that was released in v9.6.0. This bug was identified with Kirby v9.5.0, and v9.6.0 fixes the issue.