-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Added box-sizing: border-box;
to...
#1711
Added box-sizing: border-box;
to...
#1711
Conversation
@benlk Can you review this and let me know if you think we need to add the |
|
…-gallery; other changes: - make the figcaption no more than 50% of height of container - left align text to match other captions - reduce padding on caption
The padding/max-height changes in df15461 are to make sure that with Very Long captions, the caption doesn't fully cover the image. But the Gutenberg gallery styles here don't match anything in Largo: we generally don't overlay captions over images. Should we try to put the captions beneath the image, like happens with the classic editor's gallery shortcode? If the gallery shortcode and the classic editor's gallery and the classic editor's image show captions in the expanded slideshow view, should the classic block? |
@benlk I'm not opposed to either way. I'd think if having them below matches Largo styles more, we should go that route.
If 3/4 of them are showing the caption in the expanded view, I'd think the 4th should show it also. Unless you think there's a use case where someone using the theme would want one instance to use that doesn't show the captions in that view? |
I don't believe there is such a case; let's make those cases consistent.
My main worry here is that, since we have Gutenberg's default stylesheet enqueued, Gutenberg will change something upstream will horribly conflict with the styles we apply here, and as a result our sites will complain. I'd love for there to be a way to get Gutenberg to enqueue its styles per-block, so that we would be able to dequeue the Gallery Block styles and replace those, but then let Gutenberg enqueue the styles for New Shiny Block until we can write custom styles for it. Should we go ahead and make drastic changes to CSS without dequeueing Gutenberg's styles? |
No. Therefore, let's not change the gallery block caption display location, yet. |
Next steps:
|
@benlk Should they all display the way they do in the classic image or in the Gutenberg block? |
My personal preference is the classic image view, because that's easier to read than the gradient background. |
also updated single image block expanded view caption styling to match the classic image.
Sounds good; can you shove screenshots in this ticket and update the changelog before we merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The background shouldn't be flat transparent; it should be Also, the figcaption in wp-block-image in the Navis slideshow state doesn't match these styles; the caption is hidden. Edit: this is fixed now. |
When testing images, we need to test all of these separate sets of conditions:
That's ... 6 * 4 * 6 = 144 different potential image types to test. 288 if we include the clicked-on Navis Slideshow as another variable. We need a plan for testing this stuff systematically, or at least a stock set of markup to test against that generates all those options. |
Also, working on this changeset and similar ones has made me doubt the usefulness of splitting the Navis Slideshow CSS out from other image-related CSS in Largo; there's a lot of common variables. I'd be in favor of generating it using the Grunt workflow from LESS, where we could set shared variables between the other image code and the slideshow code. The slideshow CSS/JS should still only be enqueued when needed. |
Another image case to consider:
|
figcaption { | ||
box-sizing: border-box; | ||
text-align: left; // override Gutenberg's figcaption centering | ||
padding: 10px; // reduce blank space, because clicking on the figcaption doesn't trigger a click on the image to open the gallery. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix padding (one space is missing).
@@ -222,11 +223,6 @@ body.single-format-standard .navis-slideshow a.slick-next { | |||
.navis-slideshow.navis-full.alignnone { | |||
display: block; | |||
} | |||
.wp-block-image.navis-slideshow.navis-full figcaption, | |||
.wp-block-image .navis-slideshow.navis-full figcaption, /* yes, with and without space */ | |||
.navis-slideshow.navis-full .permalink { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.permalink will be rendered in slideshow after this change?
@benlk Do you want to get together and figure out a plan for acceptable criteria for getting this PR merged? |
Yeah, let's set aside time tomorrow to test this. |
IIRC, the plan we had discussed on that day was:
|
Do we know what's going on in Firefox where opening the modal scrolls the browser to the top of the page, triggering the appearance of the sticky nav? #1745 |
There's a difference in how the image block and Gallery block display their images, with whether the images are stretched to full size: <figure class="wp-block-image navis-slideshow navis-single navis-full" style="max-width: 100%;">
<span class="navis-before">X</span>
<img
src="http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM.png"
alt=""
class="wp-image-1884"
srcset="http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM.png 420w, http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM-140x140.png 140w, http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM-336x333.png 336w, http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM-60x60.png 60w, http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM-96x96.png 96w"
>
<figcaption>Largo is a responsive WordPress theme framework designed for news publishers. Finely-crafted and expertly-honed by the product and technology team at the Institute for Nonprofit News.</figcaption>
</figure> <ul class="wp-block-gallery columns-1 is-cropped">
<li class="blocks-gallery-item">
<figure class="navis-slideshow navis-single navis-full" style="max-width: 100%;">
<span class="navis-before">X</span>
<img
src="http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM.png"
alt=""
data-id="1884"
data-link="http://largodev.innsandbox.wpengine.com/?attachment_id=1884"
class="wp-image-1884"
srcset="http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM.png 420w, http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM-140x140.png 140w, http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM-336x333.png 336w, http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM-60x60.png 60w, http://largodev.innsandbox.wpengine.com/wp-content/uploads/2019/07/Screen-Shot-2019-07-17-at-2.48.12-PM-96x96.png 96w"
>
<figcaption>Largo is a responsive WordPress theme framework designed for news publishers. Finely-crafted and expertly-honed by the product and technology team at the Institute for Nonprofit News.</figcaption>
</figure>
</li>
</ul> |
I'm not sure it's a known issue; I'll create a ticket for it and let's merge this. #1745 isn't in this milestone either. |
figcaption
and.wp-caption-text
elements so that the caption text doesn't overflow from the parent container. Issue #1702