Unnecessary padding from toolbar classes (Gin Toolbar Support)

Created on 19 March 2023, over 1 year ago
Updated 25 July 2023, over 1 year ago

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.

πŸ› Bug report
Status

Needs work

Version

2.1

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada mandclu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mandclu
  • @mandclu opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡¨πŸ‡¦Canada mandclu

    Turns 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.

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    Having trouble duplicating this on the latest 1.0.x. Is there anything non-default about either of these themes?

  • πŸ‡¨πŸ‡¦Canada mandclu

    I 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.

  • πŸ‡¨πŸ‡¦Canada mandclu

    Oh 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.

  • πŸ‡¨πŸ‡¦Canada mandclu

    I 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.

  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    Confirmed that this is still an issue.

  • πŸ‡ΊπŸ‡ΈUnited States brianperry

    Also 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.

  • First commit to issue fork.
  • @dieterholvoet opened merge request.
  • πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels

    I 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?

  • πŸ‡§πŸ‡ͺBelgium dieterholvoet Brussels
  • πŸ‡¨πŸ‡¦Canada mandclu

    I don't disagree with the approach of using this issue to target Gin compatibility more broadly. On the other hand, is there ever a circumstance where having a toolbar class on the content in the preview window is likely to be useful?

  • Status changed to Needs work over 1 year ago
  • πŸ‡¨πŸ‡¦Canada mandclu

    With 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:

Production build 0.71.5 2024