kirbydesign / designsystem

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

Checkbox, Radio: fix slotted text not wrapping #3649

Closed RasmusKjeldgaard closed 1 month ago

RasmusKjeldgaard commented 1 month ago

Which issue does this PR close?

This PR closes #3648

What is the new behavior?

Adding text in the default slot of checkbox or radio will now wrap, similar to how it does for text set with the text-property. The white-space style declaration is moved to the label-text-wrapper part as it is used for both types of text.

Does this PR introduce a breaking change?

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

What is the reason for not letting the label text flow and wrap naturally - equivalent to white-space: normal (initial value)?

Excellent question! I forgot to mention it in the PR description, sorry! It is to preserve the functionality for creating line-breaks when text is supplied via the text property. So definitely something we should look into removing down the line, now that content can be slotted instead of supplied as a property.

image