redoc icon indicating copy to clipboard operation
redoc copied to clipboard

Large whitespace between headers

Open hlascelles opened this issue 5 years ago • 3 comments

We are seeing, on big screens, very large gaps between headers. We are using no other CSS at all, an just the vanilla redoc js. This is different to https://github.com/Redocly/redoc/issues/874 in that that appears to be for MD screens, whereas we see this on all screens.

Affects (at least) [email protected] - [email protected]

Example:

image

The relevant HTML section:

image

To fix it we have to use:

  <style type="text/css">
    /* Remove excessive whitespace between headers */
    .dluJDj {
      padding: 0 0 !important;
    }

    .hiuczA {
      padding: 0 0 !important;
    }
  </style>

But given these class names are unstable this is not a permanent solution.

hlascelles avatar Nov 18 '19 14:11 hlascelles

I was experiencing the same issue, I solved it by having my own redoc.html and using theme option, see https://github.com/Redocly/redoc#redoc-options-object

<script>
      Redoc.init(
        'specs/spec.yml',
        {
          theme: {
            spacing: {
              sectionVertical: '5px',
            }
          },
        },
        document.getElementById('redoc-container')
...

huksley avatar Nov 26 '19 18:11 huksley

Unfortunately, the "ability to simple branding/styling" is on the roadmap (per redoc's README), but in the mean time, theme.ts has some other properties. Specifically, I've had luck setting the typography.headings.lineHeight to a slightly lower value:

{
  "noAutoAuth": true,
  "hideDownloadButton": true,
  "theme": {
    "spacing": {
      "sectionVertical": "35"
    },
    "typography": {
      "headings": {
        "lineHeight": "1.2em"
      }
    }
  }
}

This is the json blob I'm passing into the cli via options, or into the Redoc.Init() call.

rs-wilson avatar Feb 13 '20 21:02 rs-wilson

Just encountered this myself, adding my magic spells to the list:

.hutltu {
    padding: 10px 0 0 40px !important;
}

.hutltu h1 {
    line-height: normal;
}

CoenraadS avatar Dec 30 '23 05:12 CoenraadS