-
Notifications
You must be signed in to change notification settings - Fork 207
Make thumbnails grid- and flexbox-compatible #905
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
Comments
This would allow users to either use css grid or flex (which we could also implement here directly).
Using css flex would be a good idea. It requires a bit of understanding but would be a benefit.
|
Agreed. At the very least, adding a parent |
... regarding a new dependency, maybe that could be opt-in, like
or something. But I am no expert here, happy to hear what you (and others) think @alexisthual ! |
I tried something locally:
My take is that we don't need However, I'd be in favour of doing a small refactoring the thumbnail. Currently, the div's height won't scale to it's content's height. I guess this is because html figure captions don't play well with divs. It seems that a The following structure would make sense to me: <a class="sphx-glr-thumbcontainer">
<img />
<div class="sphx-glr-thumb-title">title</div>
</a> as opposed to the current structure: <div class="sphx-glr-thumbcontainer">
<figure class="align-default">
<img />
<figcaption>
<p><span class="caption-text"><a class="reference internal"><span class="std std-ref">title</span></a>
</span><a class="headerlink" title="Permalink to this image">¶</a></p>
</figcaption>
</figure>
</div> I tested it and it feels much nicer. This could potentially break some css added by users on top of What do you think? 🙂 |
I agree that this is most likely the case. If we can git image + caption to fit without any trickery, and make some clear note about how to adjust CSS to deal with the change, I think it can be considered a bugfix and released without a deprecation cycle. |
Uh oh!
There was an error while loading. Please reload this page.
At the moment, sphinx-gallery generates a div for each gallery item.
These divs are
float: left
and have a pre-determined width, which does not render very nicely on most screen sizes or for long titles.I suggest that for each subsection of the gallery, we add a parent div to these item divs.
This would allow users to either use css
grid
orflex
(which we could also implement here directly).It boils down to adding a new div before iterating through each gallery item and closing this div after:
sphinx-gallery/sphinx_gallery/gen_rst.py
Lines 371 to 382 in a68a486
Also, maybe we could use
sphinx-design
to handle the grid for us, but this would add a new dependency.Happy to here what you think about this!
The text was updated successfully, but these errors were encountered: