-
Notifications
You must be signed in to change notification settings - Fork 9
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
Cards: Add a method of specifying a non-default image size #28
Comments
Hi @jon-harper I prefer the idea of having a dedicated option to the existing Just to clarify, are you recommending something like this? >
and then having HTML generated with images having |
Roberto - Glad to help and glad that you like the idea! Your approach makes a lot of sense to me, particularly being able to pass With a class parameter, Hope this is helpful! Edit: I was having my first cup of coffee when I replied. I think I might have restated exactly what you already said. 🤦♂️ |
Hi @jon-harper, I didn´t add an option to control the height of images because I realized it would be ambiguous (does it refer to a CSS height applied with styles as we discussed, or does it refer to the I opted for a name like in React - since "class" is a keyword in Python, so Sorry for taking 2 weeks to do this, but I dedicated time to my other projects and I applied some more improvements (e.g. adopting |
Reopening because I need to document this feature. I'll close this issue once the feature is documented. |
No need to apologize! Thanks for implementing the feature!
…On Tue, Dec 20, 2022, 4:37 PM Roberto Prevato ***@***.***> wrote:
Reopening because I need to document this feature. I'll close this issue
once the feature is documented.
—
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC2NUY5GFUNVWEBQYXZMFDDWOIYK3ANCNFSM6AAAAAASQ5MZFA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @jon-harper @RobertoPrevato. I really like the style of the cards! However, I am very lost when it comes to css, creating classes, etc. I was wondering a couple of things:
Thank you very much! |
With the changes @RobertoPrevato made, you can pass a custom
Look into GLightBox. It offers that kind of functionality. |
@jon-harper Thank you very much for the quick answer! I am afraid that it still goes a bit above my head. How do I pass the class-name to the cards when writing markdown? I have something like this:
I took a look at glightbox, but it is not really what I am looking for. Thanks for the suggestion! |
Hi @joseale2310 Markdown gets built into HTML, so you can still use CSS to style the result. I prepared an example for you: ## Bigger
::cards:: cols=3 class_name="bigger"
- title: Zeus
content: Lorem ipsum dolor sit amet.
image: ./img/icons/001-zeus.png
- title: Athena
content: Lorem ipsum dolor sit amet.
image: ./img/icons/003-athena.png
- title: Poseidon
content: Lorem ipsum dolor sit amet.
image: ./img/icons/007-poseidon.png
- title: Artemis
content: Lorem ipsum dolor sit amet.
image: ./img/icons/021-artemis.png
- title: Ares
content: Lorem ipsum dolor sit amet.
image: ./img/icons/006-ares.png
- title: Nike
content: Lorem ipsum dolor sit amet.
image: ./img/icons/027-nike.png
::/cards::
## Smaller
<style>
.smaller .nt-card .nt-card-image img {
height: 60px;
}
.smaller .nt-card .nt-card-image {
min-height: 60px;
}
</style>
::cards:: cols=6 class_name="smaller"
- title: Zeus
content: Lorem ipsum dolor sit amet.
image: ./img/icons/001-zeus.png
- title: Athena
content: Lorem ipsum dolor sit amet.
image: ./img/icons/003-athena.png
- title: Poseidon
content: Lorem ipsum dolor sit amet.
image: ./img/icons/007-poseidon.png
- title: Artemis
content: Lorem ipsum dolor sit amet.
image: ./img/icons/021-artemis.png
- title: Ares
content: Lorem ipsum dolor sit amet.
image: ./img/icons/006-ares.png
- title: Nike
content: Lorem ipsum dolor sit amet.
image: ./img/icons/027-nike.png
::/cards::
Normally you put custom CSS rules in dedicated files, and then configure those files in extra_css:
- example/your_css_file.css But you could even embed I still have to document the And thanks @jon-harper for helping! ☀️ |
This is perfect! Thank you both so much! |
I'm using card grids both as a "big link button" and for an image gallery (along with glightbox).
I've basically used your stylesheet and hand-rolled the pages. In my own included CSS file I have an
nt-gallery
class, as well asnt-gallery-image
andnt-gallery-title
(no text class). I copied and then tweaked the settings from your own CSS file:I'm using both side-by-side with good success:
You can see on top cards using
nt-card-*
and below the modified gallery version.Proposal
I propose to add a variable to pass to the
card()
call with the desired image height. From there it could calculatemin-height
values to apply as well.An alternative would be a
card_gallery()
function that applies slightly modified styles, as I have done.By the way, thank you for this project. It's done wonders for my documentation.
The text was updated successfully, but these errors were encountered: