Skip to content

Instantly share code, notes, and snippets.

@vbsessa
Last active August 31, 2024 12:59
Show Gist options
  • Save vbsessa/6150f39d1e92699e9c2f49e58fcbcc03 to your computer and use it in GitHub Desktop.
Save vbsessa/6150f39d1e92699e9c2f49e58fcbcc03 to your computer and use it in GitHub Desktop.
How to customize Firefox devtools fonts
  1. Open ~/.mozilla/firefox/<your_profile>/chrome/userContent.css (create it if does not exist).

  2. Paste the following content in it.

     @namespace url(http://www.w3.org/1999/xhtml);
     @-moz-document regexp("chrome://browser/content/devtools/**/.*"){
         .devtools-monospace {
             font-family: Consolas, monospace !important;
             font-size: 8pt !important;
         }
     }
    
  3. Restart Firefox.

@Mikhail22
Copy link

Mikhail22 commented Apr 28, 2020

Not working, Win 10, Firefox 75

@sh4rov
Copy link

sh4rov commented Jun 10, 2020

Not working, Linux Manjaro, Firefox 77.0

@Flashwalker
Copy link

Works with Pale Moon

@anithegregorian
Copy link

This one works on FF => 68.0 Linux with userChrome.css or userContent.css. Inspector tools are now using CSS variables and the inspector tree itself is loaded in an iframe so none of the tweaks actually worked esp. with .CodeMirror classes.

You can find all the variables in this file (just copy paste below URL in FF to view source)

resource://devtools/client/themes/variables.css

For the userChrome.css part here's what solved it for me.

/* @namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); */

:root {
  /* Text sizes */
  --theme-code-font-size: 13px !important;
}

If userChrome.css is not loaded create userContent.css and add the same rulesets. Tried and tested on FF Mac/Linux 89

Copy link

ghost commented May 15, 2022

No longer works on firefox 102

@jgentil
Copy link

jgentil commented May 26, 2022

Works fine but you have to put it in userContent.css and NOT userChrome.css as devtools are considered content panes.

@vbsessa
Copy link
Author

vbsessa commented May 26, 2022

Updated according to @jgentil words.

@aleclarson
Copy link

aleclarson commented Nov 5, 2022

I recommend perusing this link if you're having troubles:
https://www.userchrome.org/how-create-userchrome-css.html

And as @jgentil said, replace userChrome.css with userContent.css for devtools customization.

@kidzgy
Copy link

kidzgy commented Aug 30, 2024

@-moz-document url-prefix("chrome://devtools/content"){
.devtools-monospace {
font-family: "Cascadia Mono", "Consolas", "Sarasa Gothic SC", "Microsoft Yahei UI" !important;
}
}

put it in userContent.css

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