Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sticky navigation tabs have wrong spacing in Insiders 4.15.2+ #3950

Closed
5 tasks done
StarfallProjects opened this issue May 25, 2022 · 7 comments
Closed
5 tasks done
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@StarfallProjects
Copy link
Sponsor Contributor

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

In mkdocs-material-8.2.15-insiders-4.15.2 the top nav menu is small.

It was ok in mkdocs-material-8.2.15-insiders-4.15.1 (rolling back to that version fixed it)

image

Expected behaviour

A nicely-tyled top nav

Actual behaviour

A not-nicely styled top nav

Steps to reproduce

  1. Install mkdocs-material-8.2.15-insiders-4.15.2
  2. Build or serve

Package versions

  • Python: 3.10.2
  • MkDocs: 1.3.0
  • Material: mkdocs-material-8.2.15-insiders-4.15.2 (note that I haven't tried with non-insiders)

Configuration

https://github.com/n8n-io/n8n-docs/blob/main/mkdocs.yml (I have tested it without the extra_css)

System information

  • Browsers: tested in Chrome, Firefox, Edge
  • My OS is Windows 10, but this is also happening on our live site, which is built by Netlify (their build image is Ubuntu-based I believe)
@squidfunk
Copy link
Owner

Thanks for reporting. You say you tested without the extra CSS, but then I'm wondering why our documentation page doesn't exhibit the same behavior. Have you checked whether the error might be triggered by your overrides? I'm asking, because you ticked the box, but I'm having trouble to reproduce it.

@squidfunk squidfunk added the needs reproduction Issue lacks a minimal reproduction .zip file label May 25, 2022
@StarfallProjects
Copy link
Sponsor Contributor Author

Still seeing it with overrides removed (my apologies for not checking properly before)

image

Here is the mkdocs.yml in my test, excluding the nav:

site_name: n8n Documentation
theme:
  name: material
  favicon: _images/favicon.ico
  font:
    text: Open Sans
  language: en
  logo: _images/n8n-docs-icon.svg
  palette:
      scheme: light
  features:
    # https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/?h=navigation+tabs#navigation-tabs
    - navigation.tabs
    - navigation.tabs.sticky
    # https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/?h=navigation+tabs#anchor-tracking
    - navigation.tracking
extra:
  analytics:
    provider: google
    property: UA-146470481-3
  consent:
    title: Cookie and analytics consent
    description: 
      We use cookies (and other similar technologies) to collect data in order to improve our site. You have the option to opt-in or opt-out of certain cookie tracking technologies. For more information on privacy and data management at n8n, refer to our <a href="https://n8n.io/legal/privacy" target="_blank">privacy policy</a>.
markdown_extensions:
  # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/?h=attr#attribute-lists attr_list is required for several other features. Always enable.
  - attr_list
  # https://squidfunk.github.io/mkdocs-material/reference/admonitions/?h=admoni
  - admonition
  # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/#markdown-in-html
  - md_in_html
  # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/#superfences Used for tags, setting unique templates for certain pages, and other custom frontmatter.
  - meta
  - pymdownx.details
  # https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/
  - pymdownx.emoji:
      emoji_index: !!python/name:materialx.emoji.twemoji
      emoji_generator: !!python/name:materialx.emoji.to_svg
  # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/#highlight
  - pymdownx.highlight:
      linenums: true
  # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/#superfences Superfences is required for several other features. Always enable.
  - pymdownx.superfences
  - pymdownx.tasklist:
      custom_checkbox: true
  # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/#inlinehilite
  - pymdownx.inlinehilite
  # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/#snippets
  - pymdownx.snippets
  # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/#tabbed
  - pymdownx.tabbed:
      alternate_style: true
  - tables
  # https://www.mkdocs.org/user-guide/writing-your-docs/#linking-to-pages
  - toc:
      permalink: "#"
plugins:
  - search
  - literate-nav

@StarfallProjects
Copy link
Sponsor Contributor Author

Created a test repo: https://github.com/StarfallProjects/n8n-docs-test

@squidfunk
Copy link
Owner

Thanks! Does it go away when you remove navigation.tabs.sticky? Otherwise, are you able to further reduce the example?

@StarfallProjects
Copy link
Sponsor Contributor Author

Removing navigation.tabs.sticky seems to fix it, yes!

@squidfunk squidfunk added bug Issue reports a bug and removed needs reproduction Issue lacks a minimal reproduction .zip file labels May 25, 2022
@squidfunk squidfunk changed the title Possible style issue in latest insiders release Sticky navigation tabs have wrong spacing in Insiders 4.15.2+ May 25, 2022
@squidfunk
Copy link
Owner

squidfunk commented May 28, 2022

Fixed in d3c587b. This bug was exclusive to Insiders and was introduced with the release of navigation.prune. The tabs items received the wrong classes when tabs were made sticky, as they are now rendered as part of the header partial. This partial defined a Jinja class variable that leaked into the tabs item partial. Classes are now properly cleared.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label May 28, 2022
@squidfunk
Copy link
Owner

Released as part of 8.2.16+insiders-4.16.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants