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

Navbar is extending too far down on small screens #42

Closed
DavisVaughan opened this issue Mar 21, 2019 · 4 comments · Fixed by #48
Closed

Navbar is extending too far down on small screens #42

DavisVaughan opened this issue Mar 21, 2019 · 4 comments · Fixed by #48

Comments

@DavisVaughan
Copy link
Member

We haven't noticed this issue on any tidyverse packages (because their names are so short), but when the name of a package is long enough and the screen isn't very wide, you end up moving the "part of tidymodels 0.0.1" to the next line, which can cover up some of the screen, especially on mobile.

Here is what it looks like on a full screen laptop (all good here)

Screen Shot 2019-03-21 at 12 24 16 PM

But when you shrink the screen really far you get...

Screen Shot 2019-03-21 at 12 24 02 PM

Unfortunately, this is what it defaults to on most mobile screens because they aren't wide enough. Here is my iPhone 6s:

IMG_6405

Clearly I just need to choose shorter package names.

@dpprdan
Copy link

dpprdan commented May 6, 2019

This also happens with tidyverse packages in the wild, see e.g. ggplot2 (Screenshot from Firefox on a Moto G5 plus (Full HD Screen)).

grafik

With even longer package names, the "part of ..." text gets wrapped on a new line.

grafik

There are two issues IMO:

  1. better text wrapping in the navbar (or placing the "part of ..."/version text somewhere else)
  2. making sure that the navbar does not cover the page text.

Is this something that could be fixed directly in pkgdown?

@jayhesselberth
Copy link
Contributor

You could hide the info div on mobile classes, similar to what was done in r-lib/pkgdown#932

Update this div:

<div class="info">
<span class="partof">part of {{#yaml}}{{{part_of}}}{{^part_of}}the <a href="https://tidyverse.org">tidyverse</a>{{/part_of}}{{/yaml}}</span>
<span class="version version-{{#development}}{{version_label}}{{/development}}" data-toggle="tooltip" data-placement="bottom" title="{{#development}}{{version_tooltip}}{{/development}}">{{#package}}{{version}}{{/package}}</span>
</div>

with:

<div class="info hidden-xs hidden-sm">

@jayhesselberth
Copy link
Contributor

Also we added headroom to pkgdown so the navbar will disappear on mobile when scrolling.

@dpprdan
Copy link

dpprdan commented May 26, 2019

@jayhesselberth headroom is only a partial solution IMO, like I mentioned in r-lib/pkgdown#1041 (comment). But hiding the "part of ..." ought to work with the usual package name lengths.

hadley added a commit that referenced this issue Apr 8, 2020
@hadley hadley closed this as completed in #48 Apr 8, 2020
hadley added a commit that referenced this issue Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants