kirbydesign / designsystem

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

Image Banner: add slots for title and body text #3671

Closed troelslenda closed 3 weeks ago

troelslenda commented 1 month ago

Which issue does this PR close?

This PR closes #3670

What is the new behavior?

Title and body text can now be provided as custom/slotted content if title and bodyText string inputs do not suffice. Additionally an option to adjust min-height is fix

Does this PR introduce a breaking change?

Are there any additional context?

Checklist:

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

Reminders

Review

When the pull request has been approved it will be merged to develop by Team Kirby.

RasmusKjeldgaard commented 1 month ago

I think these are some solid improvements!

But as you also hint at in the issue, individual inputs for the component can become bloated over time - later we might need to add hasMaximumHeight, onlyTruncateOnSmallScreen etc.

Instead we could allow users to compose this, if they need something else than the default behavior. So for instance for the title, we can add <ng-content select="[title]"></ng-content>, and then consumers can do

<kirby-x-image-banner>
    <p title>My custom title!</p>
</kirby-x-image-banner>

Same approach can be used for body text.

Will get back to you on the min-height issue after talking with @henrikvoetmand.

troelslenda commented 3 weeks ago

@RasmusKjeldgaard The changes were approved by @henrikvoetmand I have updated the PR to use slotted properties instead.