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

Docs: disable Read the Docs flyout without using CSS #15851

Open
humitos opened this issue Apr 24, 2024 · 2 comments
Open

Docs: disable Read the Docs flyout without using CSS #15851

humitos opened this issue Apr 24, 2024 · 2 comments
Labels
bug 🐛 CSS/SCSS requires change to CSS/SCSS files documentation

Comments

@humitos
Copy link

humitos commented Apr 24, 2024

Describe the bug

I found that you are hiding the Read the Docs flyout shown at the bottom right by using CSS in this line: https://github.com/pypi/warehouse/blob/main/docs/user/stylesheets/extra.css#L13 and there is no need to do it via CSS. You can simple disable it from the Read the Docs dashboard with a checkbox.

Expected behavior

The flyout can be disabled from the dashboard without requiring any coding. Just:

  1. Go to the https://beta.readthedocs.org/dashboard/docspypiorg/edit/
  2. Click on "Addons (Beta)" from the left bar
  3. Uncheck "Flyout enabled"
  4. Done 👍🏼

To Reproduce

  1. Go to https://docs.pypi.org/
  2. Inspect the DOM and see that readthedocs-flyout element has the property display: none;

Additional context

Note that Read the Docs is free for Open Source projects. The flyout, besides providing extra features to the readers, was our1 way to tell users the site was hosted by Read the Docs and promote our platform more broadly. Since we added the ability to hide the flyout on projects, we may eventually ask users to show some support here communicating the hosting provider in some way. Similar to what CPython's theme is doing by showing "Hosted on Read the Docs" at the bottom right (see python/python-docs-theme#165). This is not required, but it would be pretty much appreciated 🙏🏼

Footnotes

  1. I work at Read the Docs 😃

@humitos humitos added bug 🐛 requires triaging maintainers need to do initial inspection of issue labels Apr 24, 2024
@humitos humitos changed the title Docs: disable Read the Docs flyout _without_ using CSS Docs: disable Read the Docs flyout without using CSS Apr 24, 2024
@ewdurbin
Copy link
Member

FWIW it was hidden only because of the misleading version picker since all our docs are versionless. I’ll take a closer look at this configuration

@humitos
Copy link
Author

humitos commented Apr 24, 2024

Ah, OK. That issue should be already fixed. By removing the CSS line, it should look like this:

Screenshot_2024-04-24_16-26-58

Note there are is "Versions" section in the flyout generated.

You may want to style it little bit to increase the font, since you are using Material for MkDocs, tho. I've done this in my testing project at https://test-builds.readthedocs.io/en/mkdocs-material/ that you can take a look if you want.

This is the CSS I've used there is:

:root {
    /* Reduce Read the Docs' flyout font a little bit */
    --readthedocs-flyout-font-size: 0.7rem;

    /* Reduce Read the Docs' notification font a little bit */
    --readthedocs-notification-font-size: 0.8rem;

    /* This customization is not yet perfect because we can't change the `line-height` yet. */
    /* See https://github.com/readthedocs/addons/issues/197 */
    --readthedocs-search-font-size: 0.7rem;
}

Let me know if that helps 👍🏼

@miketheman miketheman added CSS/SCSS requires change to CSS/SCSS files documentation and removed requires triaging maintainers need to do initial inspection of issue labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 CSS/SCSS requires change to CSS/SCSS files documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants