Problem/Motivation
When this module is used with the Gin Toolbar module extra space appears above the page in the preview pane (highlighted in red):

Proposed resolution
Tweak the CSS this module provides, to hide the unneeded spaces.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | Screenshot 2023-07-25 at 8.54.57 AM.png | 2.28 MB | mandclu |
| #17 | Screenshot 2023-07-25 at 8.55.35 AM.png | 1.12 MB | mandclu |
| #11 | Screenshot at Jun 09 08-16-27.png | 353.23 KB | brianperry |
Issue fork same_page_preview-3348897
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
Comment #3
mandclu commentedTurns out the space at the bottom was just the background showing where the node display wasn't long enough to cover, so nothing to worry about. I created a merge request that should remove the unneeded spacing at the top.
Comment #5
brianperryHaving trouble duplicating this on the latest 1.0.x. Is there anything non-default about either of these themes?
Comment #6
mandclu commentedI was using the default, vertical toolbar for Gin. I imagine that it would be different if you were using the horizontal toolbar for Gin it might not need this, but not sure.
Theoretically it might be possible to recode this to look for classes that start with the name of the current admin theme, but not sure how many other admin themes would follow this convention.
Certainly wouldn't hurt to leave the issue open for more feedback.
Comment #7
mandclu commentedOh forgot to mention: part of this patch also removes from the render array a "node_preview" section that in my testing was empty but still had padding, and contributed half of the observed blank space at the top. Since it didn't seem to be doing anything useful (and targetting it via CSS wasn't working for me) I decided to remove it entirely.
Comment #8
mandclu commentedI realized that the extra padding was actually introduced by the Gin Toolbar module instead of the theme itself. So if you're using the theme without the module, that could account for not seeing the extra spacing.
I've update the MR to target the class exclusion based on the word 'toolbar' instead of looking for the 'gin--' pattern.
Comment #9
mandclu commentedComment #10
brianperryConfirmed that this is still an issue.
Comment #11
brianperryAlso noticed that with Gin toolbar disabled the styles on the header of the new window preview are disrupted. Perhaps this could become more of a 'support Gin Toolbar' issue.
Comment #14
dieterholvoet commentedI started a new MR targeting 2.1.x. Since this is now stripping all classes containing the word 'toolbar', including e.g. Admin Toolbar related classes, maybe we should keep this issue focused on that and open any follow-up issues for Gin incompatibilities?
Comment #15
dieterholvoet commentedComment #16
mandclu commentedI agree with the approach of using a separate issue to target Gin compatibility more broadly, and keep this one more focused on toolbar padding specifically.
Comment #17
mandclu commentedWith this patch applied, I still see padding at the top of the page in Gin:

The culprit seems to be an empty div for the secondary toolbar, which Gin assigns a height:

Comment #18
dieterholvoet commentedI rebased the MR, not sure if anything else needs to be done here.
Comment #21
dieterholvoet commentedSeems like this has been added in 3.0.0-beta1: