This issue has already been reported in this issue within the Zen theme project.

To summarize, the Settings Tray module is adding a HTML div element with the class "offcanvas-lining" within its template named "outside-in-page-wrapper.html.twig", located at outside_in/templates/outside-in-page-wrapper.html.twig. This div is then styled to cover the entire page with absolute positioning and a background color of #333. Similar to the issue above, I also encountered a problem with this when trying to implement my own custom theme by extending the core Classy theme. When the Settings Tray module is enabled while using such a base theme, the entire page is covered by the div mentioned above, such that the entire page is inappropriately covered by a gray box, even when there is neither a Settings Tray overlay opened nor the Editing mode engaged.

This div appears to possible be a vestigial part of the Settings Tray module that can safely be removed without affecting the module's functionality. I'm submitting a patch here for review to do just that.

Comments

michael_wojcik created an issue. See original summary.

michael_wojcik’s picture

StatusFileSize
new943 bytes

Submitting a patch for removing the offcanvas-lining div in question. Initial local testing confirms that this removal does not affect the normal functioning of the Settings Tray module, while successfully getting rid of the offending gray box overlay.

tkoleary’s picture

StatusFileSize
new742.66 KB

@michael_wojcik

Let me give you some background on this so you can understand the reasoning behind the off-canvas lining divand maybe we can get to a solution that solves the problem in a way that doesn't impact themes.

The experience that we are trying to effect is demonstrated in this attached video recorded with your patch applied. As you can see the tray slides in but not at it's full height and then 'grows' towards the bottom of the viewport, so there's a moment between the slide in and the 'grow' where you can see a blank gap at the bottom of the tray.

Some constraints around trying to fix this are that the jquery dialog is 'created' and loaded in a single function so it's not possible to add a lining element under the tray with CSS to conceal this effect because any css would only apply after the jquery animation had already run. Our solution was to add this div at z-index -1 and give it the same background color as the tray so that it's already there when the main-canvas wrapper 'shrinks' and reveals what is behind it. Unfortunately as you have seen in Zen, not all themes have a background color set on body as Bartik does and where that is the case you'll see the background color of the lining element.

To make a long story short, the implementation of the lining as it exists right now is clearly not optimal but a patch that removes it should make an attempt at replacing it with code that handles the problem it was created to solve. It may seem like a very minor visual artifact that passes quickly, but it looks sloppy and gives a poor impression of finish that hurts the overall experience of the feature.

michael_wojcik’s picture

@tkoleary

Thanks very much for the background information and demo video! That was super helpful!

I've modified my original patch to add an additional fix to the issue you mentioned. So, the patch is still removing the old offcanvas-lining div and its CSS. But it is now also taking advantage of the jQuery UI API being used for the dialog boxes in question, such that a correct height is set as an option on each setting tray before it is created/rendered.

I've included the new patch and an interdiff for your reference.

Cheers,
Michael

tkoleary’s picture

Status: Needs review » Reviewed & tested by the community

@michael_wojcik

Perfect. Nice work!

xjm’s picture

Status: Reviewed & tested by the community » Needs review

I like having less code. I also confirmed that we use JS like this for the window height in misc/dialog/dialog.position.js and in offcanvas.js.

That made me wonder, though. Does this JS belong in offcanvas and not in Settings Tray's implementation?

tedbow’s picture

Status: Needs review » Needs work

@michael_wojcik thanks for the fix!
re @xjm

That made me wonder, though. Does this JS belong in offcanvas and not in Settings Tray's implementation?

Yes this should be in offcanvas.js

Adding as child of #2784443: Move off-canvas functionality from Settings tray module into drupal.dialog.ajax library so that other modules can use it
All the child issue need to be take of first.

michael_wojcik’s picture

@tedbow
@xjm

Thanks for the feedback! I've re-rolled the patch again, to move the JS to offcanvas.js. I hope that's what you meant! If not, I might need a bit more background. Thanks again!

michael_wojcik’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: removes-offcanvas-lining-div-2825154-8.patch, failed testing.

michael_wojcik’s picture

Status: Needs work » Needs review
StatusFileSize
new1.5 KB
new619 bytes

Minor fix to last patch, based on failed automated testing.

tedbow’s picture

Status: Needs review » Reviewed & tested by the community

@michael_wojcik looks to me! Thanks!

  • xjm committed 6a1f068 on 8.3.x
    Issue #2825154 by michael_wojcik, tkoleary, tedbow: "offcanvas-lining"...

  • xjm committed e4450ef on 8.2.x
    Issue #2825154 by michael_wojcik, tkoleary, tedbow: "offcanvas-lining"...
xjm’s picture

Version: 8.3.x-dev » 8.2.x-dev
Status: Reviewed & tested by the community » Fixed
Issue tags: +JavaScript

Thanks @tedbow and @michael_wojcik!

Committed 6a1f068 and pushed to 8.3.x and 8.2.x (since this is an alpha experimental module, we can make these changes in 8.2.x as well). Thanks!

Also retroactively tagging as including JavaScript so the JS maintainers can see this issue. The fix makes sense to me and seemed straightforward enough that I did not block this issue on a JS mainainer review, but just in case.

michael_wojcik’s picture

@xjm

That's great news, thanks!

BTW, I'm a new core contributor, so I'm not sure how things work, but will this commit show up on my profile as something I authored? I was really excited to get my first core commit :-)

tedbow’s picture

Issue summary: View changes
StatusFileSize
new122.15 KB

@michael_wojcik won't show up as authored but will add to your credited count on your profile with a link to your issues.
It's already there:

Nice work!

tkoleary’s picture

@michael_wojcik

I was really excited to get my first core commit :-)

Congratulations! Nice work.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

tedbow’s picture

Component: outside_in.module » settings_tray.module

Changing to new settings_tray.module component. @drpal thanks for script help! :)