Skip to content

Instantly share code, notes, and snippets.

@ezmac
Last active October 17, 2020 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezmac/6c617355f314d28dd3a3d0249370431d to your computer and use it in GitHub Desktop.
Save ezmac/6c617355f314d28dd3a3d0249370431d to your computer and use it in GitHub Desktop.
fix discord's layout

discord layout hack

Discord forces you to have two very large bars which are pretty much useless. A channel list and a members list. I just want chat. Ctrl+shift+I will open Dev Tools. You'll see a warning that 11/10, this is hacking you. It's not, but do your own due dilligence. Paste this and your two side bars will be much smaller.

// general flow: Select all div elements with a class.  Step through each element.  
//   Check if class name contains relevant string.
//   if so, set the width to "100px"

document.querySelectorAll('div[class]').forEach(function(elm){
  if (-1 < elm.className.indexOf('sidebar')) {
    elm.style['width']="100px";
  } 
  if (-1 < elm.className.indexOf('membersWrap')) { 
    elm.style['width']="100px";
    elm.style["min-width"]="50px";
  }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment