24 votes

For anyone that likes sticky navbars

I found myself wishing the website had a sticky navbar on desktop, so I made a Tampermonkey script to do just that. Sharing this in case anyone else was looking for something similar.

To use, just open this link with Tampermonkey installed, and you should be prompted to install it.
https://ewp.fyi/tilde-tweaks/sticky-navbar.user.js

4 comments

  1. [2]
    jennraeross
    Link
    Alternatively, if you have a css injector, this should work as well: #site-header { position: sticky; top: 0; padding: .5em!important; z-index: 5; }

    Alternatively, if you have a css injector, this should work as well:

    #site-header {
      position: sticky;
      top: 0;
      padding: .5em!important;
      z-index: 5;
    }
    
    2 votes
    1. ewpratten
      Link Parent
      I was originally going to do this with a CSS injector, but decided to do it with JS because I have some other plans that aren't so possible with just CSS. One that's already in action in my...

      I was originally going to do this with a CSS injector, but decided to do it with JS because I have some other plans that aren't so possible with just CSS.

      One that's already in action in my userscript is: shrinking the navbar on scroll

      2 votes
  2. ewpratten
    Link
    This post has been updated with a link that triggers Tampermonkey's built-in update mechanism. I only just found out about this feature lol.

    This post has been updated with a link that triggers Tampermonkey's built-in update mechanism. I only just found out about this feature lol.

    1 vote