Skip to content

Instantly share code, notes, and snippets.

@Prid13
Last active September 24, 2020 20:23
Show Gist options
  • Save Prid13/836b29347268515ad92e6bf858ab712b to your computer and use it in GitHub Desktop.
Save Prid13/836b29347268515ad92e6bf858ab712b to your computer and use it in GitHub Desktop.
Revert StackExchange sites to Old Line Height (for Mobile Bookmarklets)
javascript:var rule=".s-prose { line-height: 1.3!important; }";var css=document.createElement('style');css.type='text/css';css.appendChild(document.createTextNode(rule));document.getElementsByTagName("head")[0].appendChild(css);
javascript:var rule=".s-prose{line-height:1.3!important}.s-prose pre.s-code-block, .s-prose pre:not(.s-code-block){line-height:1.3!important;background-color:#eff0f1!important;padding:12px 8px!important;border-radius:3px!important}.s-prose pre.s-code-block code, .s-prose pre:not(.s-code-block) code{background-color:transparent!important}.s-prose *:not(.s-code-block) > code{background-color:#e4e6e8!important;padding:1px 5px!important;border-radius:0!important}.comment-text code{background-color:#eff0f1!important;padding:1px 5px!important}";var css=document.createElement('style');css.type='text/css';css.appendChild(document.createTextNode(rule));document.getElementsByTagName("head")[0].appendChild(css);

This is for use in mobile phones (iOS) via Javascript Bookmarklets,
to revert the recent formatting changes to StackExchange sites like StackOverflow


QUICK INSTRUCTIONS:

  1. choose your script:
    • only old Line Height if you only want to revert the line-height to the old compact one
    • revert more changes.js if you want additional changes like bg-colors, padding, border-radius
  2. create a Bookmark in Safari or Chrome (iOS)
  3. edit the bookmark
  4. give it a proper name (e.g. StackOverflow change line-height)
  5. replace the bookmark link with the contents of the script
  6. save
  7. go to any stackexchange website (e.g. stackoverflow)
  8. open Bookmarks
  9. choose your script bookmarklet to activate it

Remember that you have to re-activate it for each page, unfortunately

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