This is a regression from #3173008: [Code Review] wide image within article template a reusable component/class
In that patch we add the wide-image CSS class based on the field type, view mode, and is_multiple.
Evidently, we also need to check for the region.
Problem/Motivation
Original post
I updated my website to Drupal 9.2.1 and this update brings a lot of bugs to the Olivero theme.
Responsive images did not work before, but this is even worse.
The "Hero" region spills over into the "Social Bar" region. The icons in the "Social Bar" region are no longer fixed, they will disappear if I scroll the page.
Steps to reproduce
- Install the theme and enable it.
- Create a custom block type for eg (hero banner). Add a field image in it and save it.
- Add a custom block (upload an image) and save it.
- Place the block in to Hero (full width) region and save it.
- You will see the issue.
Proposed resolution
Image has extra margin-inline-start inside
.region--hero .wide-content
Reset the margin-inline-start for the .wide-content inside .region--hero only with the following code
region--hero .wide-content {
max-width: 100%;
margin-inline-start: 0;
margin-inline-end: 0;
}Remaining tasks
User interface changes
Before

After

API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | before-patch.png | 5.82 MB | shweta__sharma |
| #18 | after-patch.png | 6.1 MB | shweta__sharma |
| #2 | Le_web_made_in_France___cocoriNET.png | 988.08 KB | mherchel |
| Capture d’écran de 2021-07-08 12-32-07.png | 349.4 KB | zenimagine | |
| Capture d’écran de 2021-07-08 12-32-01.png | 404.96 KB | zenimagine |
Issue fork drupal-3222784
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3222784-olivero-wide-image-utility
changes, plain diff MR !5572
Comments
Comment #2
mherchelThanks for finding this bug!
On our dev demo site, the hero region is displaying properly (see https://tugboat-aqrmztryfqsezpvnghut1cszck2wwasr.tugboat.qa/node/23)
I was able to grab the the URL of your live site within your screenshot and inspect the CSS. It looks like this is a regression from #3173008: [Code Review] wide image within article template a reusable component/class
In that patch we add the
wide-imageCSS class based on the field type, view mode, and is_multiple.Evidently, we also need to check for the region.
Comment #3
mherchelComment #4
zenimagine commented@mherchel I just tested again and the image does not overflow if I am an anonymous user, but it does overflow if I am logged in as administrator.
Comment #5
mherchelComment #6
xjmNormal priority bug under the normal issue priority definition:
Comment #7
kostyashupenkoCan we handle it on css level, since it's easier?
Because field entity doesn't know anything about in which region its parent entity (block_content in our case) rendered. For sure there is a way to try to catch region name from field preprocess still, but we can still have feedbacks later, because it can be not block_content, but some custom block, or it can be view instead -> which means i'm not sure if we can control all possible cases to understand if our image is in hero region or not.
Maybe we can provide additional setting to the fields globally with region name where this field is rendered? Is it possible actually?
Comment #8
kostyashupenkoCan be related https://www.drupal.org/project/drupal/issues/3211651 if
Comment #10
mglamanCommenting that I experienced something similar with
primary-imageinfield--node--field-image.html.twigI placed nodes in a grid 3 wide and the images got a bit messy.
Comment #16
gauravvvv commentedImage has extra
margin-inline-startinside.region--hero .wide-content. I have removed themargin-inline-startfor the.wide-contentinside.region--heroonly. I have created MR for same. please reviewComment #17
smustgrave commentedIssue summary is missing standard template with proposed solution, steps to reproduce, before/after screenshots.
Comment #18
shweta__sharma commentedIssue summary updated.
Comment #19
shweta__sharma commentedMR 5572 has fixed the issue. We can now move this to RTBC.
Thanks
Comment #20
shweta__sharma commentedComment #21
quietone commentedI'm triaging RTBC issues.
@shweta__sharma, thank you for completing the issue summary, that really helps with reviews.
I read the IS and the comments. I don't see any response to the suggestions by @kostyashupenko in #7 and #8.
Leaving at RTBC.
Comment #22
nod_Comment #23
bnjmnmThere's already similar image-overlap-protection for other use cases in
wide-content.pcss.css, see that here. The similar code being added here should go in there, perhaps as an additional selector to a style that is already there.Comment #25
ahsannazir commentedComment #26
smustgrave commented1 small comment on MR. But if different solution is being used can issue summary be updated to reflect.
Comment #27
ahsannazir commentedComment #28
ahsannazir commentedComment #29
smustgrave commentedBelieve #23 has been addressed.
Comment #30
nod_comment #23 was not taken into account
Comment #31
ahsannazir commentedComment #32
smustgrave commentedFor the feedback from @mherchel.
Comment #33
ahsannazir commentedComment #34
smustgrave commentedChanges to core/themes/olivero/css/layout/region-hero.css may be out of scope. But it's a small change so may not be a big deal.
Comment #39
nod_Committed 8756d33 and pushed to 11.x. Thanks!