First stab at fixing the primary nav on small viewports#693
Open
DmitrySharabin wants to merge 1 commit intomainfrom
Open
First stab at fixing the primary nav on small viewports#693DmitrySharabin wants to merge 1 commit intomainfrom
DmitrySharabin wants to merge 1 commit intomainfrom
Conversation
✅ Deploy Preview for colorjs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
DmitrySharabin
commented
Nov 17, 2025
Comment on lines
+23
to
+33
| <ul class="hamburger-list"> | ||
| <li data-nav-item="0" hidden><a href="{{ page | relative }}/get/">Get Color.js</a></li> | ||
| <li data-nav-item="1" hidden><a href="{{ page | relative }}/docs/">Docs</a></li> | ||
| <li data-nav-item="2" hidden><a href="{{ page | relative }}/api/">API</a></li> | ||
| <li data-nav-item="3" hidden><a href="{{ page | relative }}/notebook/">Play!</a></li> | ||
| <li data-nav-item="4" hidden><a href="https://apps.colorjs.io/">Demos</a></li> | ||
| <li data-nav-item="5" hidden><a href="https://elements.colorjs.io/">Elements</a></li> | ||
| <li data-nav-item="6" hidden><a href="https://github.com/LeaVerou/color.js">GitHub</a></li> | ||
| <li data-nav-item="7" hidden><a href="https://discord.gg/K64FJBznq4">Discord</a></li> | ||
| <li data-nav-item="8" hidden><a href="https://opencollective.com/color">♡ Sponsor</a></li> | ||
| </ul> |
Member
Author
There was a problem hiding this comment.
As a TODO, I'd try to DRYify this part, but unfortunately, those items are not entirely identical to the nav items. Therefore, for now, I have decided to leave it as is and revisit it in the next iteration.
d60a1df to
3856f1c
Compare
- Introduce a responsive navigation system that “moves” overflowed items into a hamburger menu. These changes make the header adapt to smaller viewports and prevent wrapping/overflow of nav items. - Tweak the corresponding CSS rules and header image sizing (so it doesn’t shrink to 0 width and entirely disappear).
3856f1c to
3019f7b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prevent wrapping/overflow of nav items.
After some experiments, I’ve decided to duplicate menu items in two places (instead of programmatically moving them) to avoid DOM manipulations as much as possible. For me, it seems a reasonable trade-off since our nav menu is not huge, and RO might fire quite often.