Within Olivero, if the toolbar is open and in vertical mode, various components can create horizontal scrolling including wide images, block quotes, code blocks etc.

Issue fork drupal-3283391

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.

Saurabh Srivastava’s picture

Status: Active » Needs review
StatusFileSize
new1.16 KB
new1.53 MB

Adding the patch to fix the wide image issue for reference I am attaching the screenshot here.

pallavisk’s picture

StatusFileSize
new1.37 MB

Tested the #2 patch. The issue is not resolved as approached. UI is still breaking and showing a horizontal scrollbar after adding the patch.
Please refer to the screenshot.

mherchel’s picture

Status: Needs review » Needs work

In addition, it should not make changes to the overall design of the theme. Thanks for the patch though.

sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new1.98 KB

#5 Please verify the patch

Aamir M’s picture

Assigned: Unassigned » Aamir M
Aamir M’s picture

Assigned: Aamir M » Unassigned
Status: Needs review » Needs work
StatusFileSize
new581.34 KB
new576.77 KB

Verified patch #5 on Drupal 9.5.x
Patch applied successfully and also horizontal scrolling is removed now but UI is still breaking

Please refer to the screenshot.

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.

_utsavsharma’s picture

StatusFileSize
new2.06 KB

Please review for 10.1.x.

_utsavsharma’s picture

Status: Needs work » Needs review
vadim ansari’s picture

Assigned: Unassigned » vadim ansari
vadim ansari’s picture

Assigned: vadim ansari » Unassigned
StatusFileSize
new64.62 KB
new38.87 KB

Patch #9 applied successfully on Drupal 10.1.x and PHP 8.1.6.
Refer to screenshots.

markconroy’s picture

Status: Needs review » Needs work
  1. +++ b/core/themes/olivero/css/base/base.css
    @@ -51,6 +51,10 @@ body.is-fixed {
    +  overflow-x: hidden;
    

    I'm not sure putting overflow to hidden on the body element is a best practice solution.

    Let's find the elements that are overflowing, and fix those instead.

  2. +++ b/core/themes/olivero/css/components/wide-image.css
    @@ -33,9 +33,10 @@
    +    width: 100%;
    

    Would 'max-width' be better here in stead of 'width'. That means we would not be changing the original design, but also means on a _very_ large screen the image would not scale to the full width (if this is not desired).

  3. Let's find the items that are causing this issue, such as blockquote and start fixing those items. We don't want the code content in a blockquote or other places being cut off by an overflow: hidden.

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.

Harish1688’s picture

StatusFileSize
new2.72 KB
new1.46 KB
new394.67 KB
new227.61 KB

Based on comment #13, make the change according the suggestion and create a new patch (3283391-15.patch) for 11.x (wide-image.css renamed in wide-content.css 11.x) so it's only for 11.x. attached image for reference.
Tested the 3283391-9.patch with 10.1.x and 11.x throwing a error in applied.

Needs Review.

Before patch in 11.x
Only local images are allowed.

After patch
Only local images are allowed.

shweta__sharma’s picture

StatusFileSize
new1.41 MB
new1.01 MB

Tested patch #15 on Drupal 11 the patch is working fine for me. The horizontal scroll issue has been fixed now. Attached before/after screenshots.
Moving to RTBC
Thanks

shweta__sharma’s picture

Status: Needs work » Reviewed & tested by the community
needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work

The Needs Review Queue Bot tested this issue.

While you are making the above changes, we recommend that you convert this patch to a merge request. Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

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

kostyashupenko’s picture

After spending a hour or more on this i can say that probably this issue will never get completed and merged.
This issue requires a complete rework of css grid system.

First of all trying to resolve this issue by adding the following code is no-go, since disabling horizontal overflow with this way means there is something wrong with CSS in the tree somewhere (which is true). This code is a quick-fix, of course you can use it on your commerce projects, but it will never be merged. In Drupal core we are about to fix original issues than providing bicycles.

+ .toolbar-tray-open.toolbar-vertical.toolbar-fixed {
+   overflow-x: hidden;
+ }

Now about what we could do. The hardest part is that with wide-image we have overwritten grid with negative margins. But original issue is not related to wide-image case, but instead it's related to our CSS grid layout system which isn't taking into account vertical toolbar case. Besides, a whole grid system is complicated with several CSS variables defined. Some of them are overwriting each other on different breakpoints. And what's most important Olivero CSS breakpoint system is not equal to administration toolbar breakpoint system. But administration toolbar gives us CSS variable --drupal-displace-offset-left: 240px; which is added in html tag via style attribute. This variable is 0px when toolbar is in horizontal mode, and != 0px value when it's in vertical mode. So generally speaking we have to use this variable in our CSS grid system. But it's not easy (i tried).

I'm thinking maybe we can try to solve this issue when SDC will come in Olivero so we will replace everything by SDC components where we can re-think grid system

@mherchel what do you think ?

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.