imfing / hextra

🔯 Modern, batteries-included Hugo theme for creating beautiful doc, blog and static websites
https://imfing.github.io/hextra/
MIT License
614 stars 147 forks source link

Allow text in cards to be longer than 3 lines #420

Closed kaelemc closed 2 months ago

kaelemc commented 3 months ago

Currently text in the card component is clamped to 3 lines with the tailwind class hx-line-clamp-3

For some cards the text may be longer than 3 lines. This currently gets truncated and the text is not visible. The easy fix is to remove hx-line-clamp-3, but I assume this is not the desired fix.

Not sure how to approach this, possibly allowing the subtitle CSS to be overridden by the user?, or an overflow field which can be true (hx-line-clamp-3) or false (hx-line-clamp-none).

imfing commented 2 months ago

one way is to override layouts/partials/shortcodes/card.html in your site

another method is to use css to invalidate the rule applied to the card, specifically override the clamp-3 rule

e.g. in the custom.css:

.hx-line-clamp-3.hextra-card-subtitle {
  -webkit-line-clamp: 30;
}

image

kaelemc commented 2 months ago

Thanks 👍