Problem/Motivation

Various elements within the Olivero theme overflow beyond the "content narrow" layout to span additional grid columns.

If the admin toolbar is in vertical orientation and is open, these elements can overflow (either into sidebar or cause horizontal scrolling).

Steps to reproduce

  1. Make Olivero the default theme
  2. Go to any Basic page
  3. Make sure that some text is added with the quotes or images, videos, etc
  4. Click on manage and click to change to vertical orientation so admin toolbar is vertical
  5. Result: Verify the elements overflow when using a small screen
  6. Expected: Elements should not overflow into sidebar or cause horizontal scrolling

Proposed resolution

CSS updates to adjust overflow.

Remaining tasks

  1. Create patch
  2. Review patch
  3. Test patch
  4. Commit

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3221247

Command icon 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:

Comments

mherchel created an issue. See original summary.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

kmonahan made their first commit to this issue’s fork.

kmonahan’s picture

Status: Active » Needs review
StatusFileSize
new334.6 KB
new331.52 KB

Merge request created. Before and after screenshots attached.

kristen pol’s picture

Thanks for the MR.

Checked and the patch applies cleanly to 9.3 and 9.4 and with an offset for 10 (see below). Needs testing for all of these so tagging.

[drupal-10.0.x-dev/10.0.x] [drupal-10.0.x-dev]$ patch -p1 < 1737.diff 
patching file core/themes/olivero/css/layout/layout-content-narrow.css
Hunk #1 succeeded at 175 (offset -98 lines).
patching file core/themes/olivero/css/layout/layout-content-narrow.pcss.css
Hunk #1 succeeded at 92 (offset -44 lines).
Satyajit1990’s picture

Assigned: Unassigned » Satyajit1990
StatusFileSize
new1.07 MB

Working fine for me after applying patch file

Testing steps :
1. Go to any of the Basic page
2. Make sure that some text is added with the quotes or images, videos etc
3. Now click on manage and click on Horizontal orientation to change as vertical orientation
4. Now the admin toolbar should be in vertical orientation and verify the elements overflow issue in small screen

Version: 9.4.x
Expected : elements should not overflow either in to sidebar, or cause horizontal scrolling

Satyajit1990’s picture

Assigned: Satyajit1990 » Unassigned
Status: Needs review » Reviewed & tested by the community
lauriii’s picture

Status: Reviewed & tested by the community » Needs review

The screenshot from #7 is from Umami but this issue is against Olivero.

javi-er’s picture

Status: Needs review » Needs work
StatusFileSize
new601.09 KB
new562.58 KB

I tested this merge request and it fixes the issues with the blockquotes, but formatted content is still broken.
I generated the <pre> tag using the "formatted" paragraph format from the RTF options.

before

after

javi-er’s picture

In the case of <pre> tags, maybe overflow: scroll could be used, which is a common solution for this issue.

kristen pol’s picture

Issue summary: View changes
Issue tags: -Needs manual testing

Thanks for testing. I've updated the issue summary to use the template and added steps to reproduce based on #7. And, I've removed the "Needs manual testing" tag for now until the patch gets updated.

javi-er’s picture

StatusFileSize
new546.39 KB
new4.14 KB

Attached is a patch that applies to the merge request (drupal-3221247/3221247-olivero-various-elements) for adjusting the pre elements alignment, I couldn't find any references in Figma regarding the design / layout of pre, so I just made sure that it stays inside the container. See screenshot below.

javi-er’s picture

Status: Needs work » Needs review
kristen pol’s picture

Status: Needs review » Needs work

Thanks for the updated patch but it's not applying so moving back to needs work.

[drupal-9.4.x-dev/9.4.x] [drupal-9.4.x-dev]$ patch -p1 < olivero-3221247-13.patch 
patching file core/themes/olivero/css/layout/layout-content-narrow.css
patching file core/themes/olivero/css/layout/layout-content-narrow.pcss.css
patching file core/themes/olivero/css/layout/region-content.css
patch: **** malformed patch at line 96:  .region--content {
javi-er’s picture

Status: Needs work » Needs review

@kristen-pol, I could add the changes to the same merge request that's that was opened before: https://git.drupalcode.org/project/drupal/-/merge_requests/1737/diffs

The patch is not longer relevant, please ignore it. I'm moving this to "needs review" again.

kristen pol’s picture

Issue tags: +Needs manual testing

Thanks for the updated MR(patch). Tagging for testing for 9.4.

kristen pol’s picture

Issue summary: View changes

Embedded before screenshot in issue summary.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

gaurav-mathur’s picture

Assigned: Unassigned » gaurav-mathur
gaurav-mathur’s picture

Status: Needs review » Needs work

Patch #13 not working on drupal 10.1.x-dev.

gaurav-mathur’s picture

Assigned: gaurav-mathur » Unassigned

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

marc.bau’s picture

Can we get a fix committed, please? Still broken in 10.3.2.

marc.bau’s picture

This will help with readability of pre fields a lot...

.region--content pre {
    white-space: pre;
    white-space: pre-wrap;
    word-wrap: break-word;
}

saurav-drupal-dev made their first commit to this issue’s fork.

saurav-drupal-dev’s picture

Status: Needs work » Needs review
StatusFileSize
new228.29 KB
new410.62 KB

fix
fix

Fixing the Overflow Issue in Drupal with

 Elements

The Issue:
We encountered a layout issue in Drupal where elements like 
, blockquotes, and embedded media were overflowing into the sidebar when the vertical toolbar was present. This was messing up the layout, making the content look cluttered and out of place.

Root Cause:
The issue was happening because these elements (especially <pre>) didn’t respect the boundaries of their container. Since <pre> preserves whitespace and line breaks, it was forcing the content to extend outside the content area, causing it to overlap into the sidebar.

Steps Followed to Fix the Issue:

Identifying the Problem:

First, we identified that the primary culprit was the <pre> element. The content inside the <pre> tags wasn’t wrapping properly, and that led to the overflow problem.
Checking the CSS:

We realized that this could be a CSS issue where the <pre> block was not being handled correctly. We needed to make sure that the content inside 
 respects the container’s width.
Solution Applied: We decided to tackle this problem by applying custom CSS to ensure the 
 content stays within the container. Here’s the magic CSS that solved it: 
Thanks @marc.bau

css
Copy code

.region--content pre {
  white-space: pre;
  white-space: pre-wrap;
  word-wrap: break-word;
}

Explanation of the CSS:

white-space: pre; ensures that the whitespace inside the <pre> element is preserved.
white-space: pre-wrap; makes sure that long lines of text are wrapped properly if they exceed the width of the container.
word-wrap: break-word; ensures that if a long word or continuous string of characters is too wide for the container, it will break into the next line rather than overflowing.

Testing:

After applying this CSS, we tested the layout with different content inside <pre> blocks, and voila! The content no longer overflowed into the sidebar. The text wrapped properly, and the layout stayed intact.

smustgrave’s picture

Status: Needs review » Needs work

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Title: Olivero: various elements (blockquote, pre, embeded media) can overflow into sidebar when vertical toolbar is present » various elements (blockquote, pre, embeded media) can overflow into sidebar when vertical toolbar is present
Status: Needs work » Postponed

The Olivero theme was approved for removal in #3590816: [policy, no patch] Deprecate Olivero and move to contrib.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3595082: [meta] Tasks to deprecate the Olivero theme and the removal work in #3595085: [meta] Tasks to remove the Olivero theme.