Skip to content

Instantly share code, notes, and snippets.

@yurenchen000
Created December 29, 2022 15:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yurenchen000/c948a4afe9c6d9d77edd990325315358 to your computer and use it in GitHub Desktop.
Save yurenchen000/c948a4afe9c6d9d77edd990325315358 to your computer and use it in GitHub Desktop.
github readme.md toc maximize

Recently github has a very cramped TOC size,
Some pages are very difficult to read.

this script (paste and run in browser F12)
help maximize the TOC div size.

//github readme.md toc maximize
with(document.querySelector('readme-toc .SelectMenu-modal.mt-1').style){
  maxHeight=(document.documentElement.clientHeight-40)+'px'
  width=maxWidth='600px'
}
@yurenchen000
Copy link
Author

before:

github_md_toc_before


maximize:

github_md_toc_max

a test page:
https://github.com/luvit/luv/blob/master/docs.md


@yurenchen000
Copy link
Author

the css way:

/** float & max readme TOC **/
.SelectMenu-modal {
    width: 500px;
    max-height: 100% !important;

    position:fixed;
    top: 3px;
    right: 10px;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment