Feature Request: Closed Shortcode for card/feature-card
Feature Description
I would like the ability to create cards (both feature-card and regular card) that are closed, and their inner content is rendered as markdown in the card.
Problem/Solution
Currently, we have image, or image-less cards. However, if we had a card that was implemented as a closed shortcode: e.g.
{{< card-closed >}}
//Insert inner content here
{{< /card-closed >}}
we would be able to create cards that have code snippets too. This would be quite useful for sites that want to show code snippets as part of a gallery.
Alternatives Considered
The alternative would be just to take a screenshot of the code snippets and use the image. However, this isn't nearly as good of a solution because it would not be reactive to light/dark theme switches
Additional Context
I have a somewhat working implementation in my CardsWithInner branch on my fork. The issue that I have with my implementation is that it could do with some additional CSS to make the code match with the card a little better. You can see examples of this in the documentation for hextra and cards in the same branch.
Thanks for the feature request! Do you have any screenshots to show what it would look like?
Yeah so these are the proposed docs for the hextra/feature-cards version
And then for regular cards:
The issue is that the rounded background of the code snippet doesn't look right in the card: To better show the issue, here is the feature card version with the light theme:
Ideally you would want the code snippet background to fill the entire bottom of the card just like with image cards, but this does not.
I have this on my fork because it is good enough for me, but I think this could be good feature for mainline hextra... If someone could help with the CSS a little :)
I have just enabled github pages on my fork so you have have a look at what it currently looks like here https://kstocky.github.io/hextra/docs/guide/shortcodes/hextra/#hextrafeature-card-closed
there's a similar feature for cards being actively worked on in #809