Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KCard: Add an option to configure whether the "aboveTitle" slot with no content should occupy the area designated for it or not #702

Closed
4 of 5 tasks
MisRob opened this issue Jul 27, 2024 · 1 comment
Assignees
Labels
category: library Shared code library Component: KCard P1 - important Priority: High impact on UX

Comments

@MisRob
Copy link
Member

MisRob commented Jul 27, 2024

Summary

Consumers need to be able to choose whether the aboveTitle slot with no content should still occupy the area designated for it or not. This behavior can be configured via a new prop, preserveAboveTitle.

References

This need is motivated by new additions to the cards family in Kolibri, such as

Current behavior

When the aboveTitle slot has no content, KCard still reserves the space for in the same way as if there was content. The motivation behind this is to be able to achieve consistent alignment of title when there are more cards on the same grid row.

Expected behavior

The behavior described above should still be achievable, however we have an option to configure it via a new Boolean prop, preserveAboveTitle.

If set to true and aboveTitle has no content, the slot's area should still occupy the space designated for it (current behavior).

If set to false and aboveTitle has no content, the slot's area should be completely removed. Also note that in this case, the space above the title needs to be 24px.

Since in the first several production cards the slot is not preserved, let's set the default value to false.

Acceptance criteria

  • Implemented as specified above
  • The new prop works for all layouts
  • The new prop is documented with JSDoc string
  • There are a few unit tests for it
  • No regressions in any of the layouts
    • e.g. ensure that when aboveTitle has content, it should show no matter of preserveAboveTitle value
@AllanOXDi
Copy link
Member

fixed in #705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: library Shared code library Component: KCard P1 - important Priority: High impact on UX
Projects
None yet
Development

No branches or pull requests

3 participants