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

Website tab-line scaling switch points #1375

Closed
Finii opened this issue Oct 9, 2023 · 12 comments
Closed

Website tab-line scaling switch points #1375

Finii opened this issue Oct 9, 2023 · 12 comments

Comments

@Finii
Copy link
Collaborator

Finii commented Oct 9, 2023

🎯 Subject of the issue

On the website www.nerdfonts.com the tab bar has a strange behavior when the screen width changes...

When decreasing the width from 'very wide' at some point the tab bar will wrap to a second line, and with further width decrease it will switch to shorter tab-titles and the to a smaller font.

The switchover points seem to be wrong. Maybe they are font dependent?

Experienced behavior:

full width
image

smaller wraps tab-line into second line
image

smaller wraps more
image

smaller switches to short titles, but still to long
image

smaller, now a smaller font is used
image

@madmecodes
Copy link

I have gone through your readme.md file, and i would like to contribute in this repository, please assign this issue to me @Finii .

@Finii
Copy link
Collaborator Author

Finii commented Oct 9, 2023

Assigned ;)
The website is in the gh-pages branch. You can check your changes locally by running jekyll s on your machine and pointing your browser to the URL given by jekyll

@madmecodes
Copy link

@Finii confirming, in this image you basically want to display all short titles in one line?

smaller switches to short titles, but still to long

@Finii
Copy link
Collaborator Author

Finii commented Oct 9, 2023

Yes.

The tab line should be one line, always (as far as I think tab lines should work).

We have several switchover points.
Obviously the switchover points (depending on SCREEN width) do not match the actual font used or something.

Switching to short-tab-titles ("CHEAT CHEAT" -> "ICONS", etc) must come earlier (i.e. with wider widths already), to avoid two lined tab-line.

Switching to the smaller font also is too late.

image

In the upper image switch to the short titles should come when the tab-line starts to overflow. Now we overflow two items before it switches to short titles.

And then, the lower image: The tab lines is now too short already for short titles with big font, here it should already be short-titles small font.

@madmecodes
Copy link

okay i understood your problem, you basically want a better responsive navbar for your website.

There are bugs too in the navbar.

this is a bug

Image Alt Text

since links are lot do you want me to add collapse navigation feature for smaller screens? @Finii

@Finii
Copy link
Collaborator Author

Finii commented Oct 9, 2023

Hmm, why are there the tab titles in long-form and short-form, both?
From the code that should be impossible?
What browser is that?

image

add collapse navigation feature

Not sure what that is.
I guess when the width is too small for even the short titles with small font we could dispense of some tabs, but cheat-sheet/icons and fonts-downloads/fonts should always be there I guess

@Finii
Copy link
Collaborator Author

Finii commented Oct 9, 2023

In fact we have these 'zoom levels':

/*
 super tiny size (phones)
 point at which nav wraps
 without decrease font size
 */
@media only screen and (max-width: 326px) {
}

/* tiny size (phones) */
@media only screen and (max-width: 380px) {
}

/* mid size (tablets, landscapes) */
@media only screen and (max-width: 679px) {
}

/* anything not desktop */
@media only screen and (max-width: 767px) {
}

Nav should only wrap at 'super tiny size', as commented.
I guess the pixel widths given here are just slightly off.

@Finii
Copy link
Collaborator Author

Finii commented Oct 9, 2023

This fixes the first wrong switchover point, i.e. long-title to short-title:

diff --git a/_includes/css/skeleton.scss b/_includes/css/skeleton.scss
index 46bc86e37..3eb15b1d0 100644
--- a/_includes/css/skeleton.scss
+++ b/_includes/css/skeleton.scss
@@ -91,14 +91,14 @@
   }
 
 /* top nav tweaks */
-@media(min-width:768px) {
+@media(min-width:940px) {
        .hide-on-larger-view {
                display: none !important;
        }
 
 }
 
-@media(max-width:767px) {
+@media(max-width:939px) {
        .hide-on-smaller-view {
                display: none !important;
        }

@Finii
Copy link
Collaborator Author

Finii commented Oct 9, 2023

And this fixes the second switchover point

index 64f2c3814..4585a0066 100644
--- a/_includes/css/nerd-font-tweaks.scss
+++ b/_includes/css/nerd-font-tweaks.scss
@@ -679,6 +679,13 @@ a.nerd-font-button:before {
        }
 }
 
+@media only screen and (max-width: 785px) {
+       nav ul li {
+               min-width: 50px;
+               line-height: 40px;
+       }
+}
+
 /* anything not desktop */
 @media only screen and (max-width: 767px) {
        .container h1 {

Finii added a commit that referenced this issue Oct 9, 2023
[why]
The navbar should only be one line, switching to smaller and smaller
items, until we reach a very small size (the smallest) where we finally
allow it to overlow into the next lines.
But that is not the case, the navbar switches between one and two lines
already at medium sized screens.

[how]
Correct the width point when the navbar titles switch from long-titles
to short-titles.

Introduce new width switch point that reduces the cell widths of the navbar
one they become very full and further reduction in width would result in
overflow into the next line.

Tested on Netscape and Chromium; the later needs bigger numbers (hmm)

Fixes: #1375

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@Finii
Copy link
Collaborator Author

Finii commented Oct 9, 2023

That was so easy that even me who does never do any web programming, could finally manage it, after you pointed me in the right direction!
Thanks for the input!

@Finii Finii closed this as completed in 9f7e6ee Oct 9, 2023
@madmecodes
Copy link

nice!

Finii added a commit to VitthalGund/nerd-fonts that referenced this issue Oct 18, 2023
[why]
The navbar should only be one line, switching to smaller and smaller
items, until we reach a very small size (the smallest) where we finally
allow it to overlow into the next lines.
But that is not the case, the navbar switches between one and two lines
already at medium sized screens.

[how]
Correct the width point when the navbar titles switch from long-titles
to short-titles.

Introduce new width switch point that reduces the cell widths of the navbar
one they become very full and further reduction in width would result in
overflow into the next line.

Tested on Netscape and Chromium; the later needs bigger numbers (hmm)

Fixes: ryanoasis#1375

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants