kirbydesign / designsystem

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

[BUG] Items inside kirby-list with "shape=none" has box shadow cut off #2449

Open hjorte-bd opened 2 years ago

hjorte-bd commented 2 years ago

Describe the bug

When using the <kirby-list shape="none"> component, children inside will be wrapped in a ´kirby-list-item´ and ´ion-item-sliding´. These two wrapper elements has overflow: hidden on, which will prevent effects like box-shadow to render properly outside those wrapper items.

Describe how to reproduce the bug

  1. Create a kirby list component
  2. Put one or more kirby-cards inside
  3. Box shadow from the card component, should be cut-off

(The "List No Shape" example, in the cookbook, shows off the issue)

Which Kirby version was used?

6.3.1

What was the expected behavior?

At least the box-shadow should expand outside the box edges (see screenshot below)

Add any screenshots

What happens: (Box shadow has color changed to pink for demonstrative purposes) Screenshot 2022-08-31 at 09 47 45

How it looks with overflow: hidden on both wrapper elements: Screenshot 2022-08-31 at 09 48 31

Please complete the following information:

Are there any additional context?

No


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:

hjorte-bd commented 2 years ago

To fix, libs/designsystem/src/lib/components/list/list-item/list-item.component.scss simply need to be changed to:

@use '~@kirbydesign/core/src/scss/utils';

$divider-color: utils.get-color('background-color');

ion-item-sliding {
  overflow: visible;
}

:host-context(.has-divider) {
  ion-item-sliding:not(.last) {
    border-bottom: 1px solid $divider-color;
  }
}