Skip to content

Conversation

@DmitrySharabin
Copy link
Member

@DmitrySharabin DmitrySharabin commented Nov 17, 2025

Summary

  • 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).

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.

@netlify
Copy link

netlify bot commented Nov 17, 2025

Deploy Preview for colorjs ready!

Name Link
🔨 Latest commit 3019f7b
🔍 Latest deploy log https://app.netlify.com/projects/colorjs/deploys/691baf598d92270008d94cb9
😎 Deploy Preview https://deploy-preview-693--colorjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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">♡&nbsp;Sponsor</a></li>
</ul>
Copy link
Member Author

@DmitrySharabin DmitrySharabin Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@DmitrySharabin DmitrySharabin force-pushed the responsive-nav branch 2 times, most recently from d60a1df to 3856f1c Compare November 17, 2025 23:16
- 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).
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 this pull request may close these issues.

2 participants