27

Firefox Reader View has two fonts, serif and sans-serif. I want to change these fonts. How can I do that?

enter image description here

1

8 Answers 8

6

I wanted to change the background colour to pure black and the font colour to pure white for the "Dark" theme of the Reader. The answer that uses userContent.css from 2016 seems to be outdated, and did not work on FireFox 89. After searching the web and countless testing, here is the solution I have found.

  1. Enable userstyles from about:config by setting toolkit.legacyUserProfileCustomizations.stylesheets to true

  2. Find your profile folder in about:support, look in the table for Profile folder and click the Open Folder button.

  3. In your profile folder's root create the subfolder /chrome and a file named userContent.css. Example on Windows: C:\Users\[your Windows ID]\AppData\Roaming\Mozilla\Firefox\Profiles\[random ID]\chrome\userContent.css

  4. The CSS for changing the colours of the Dark theme was:

    @-moz-document url-prefix("about:reader")
    {
        body.dark
        {
                color: #FFFFFF !important;
                background-color: #000000 !important;
        }
    }
  1. Restart FireFox to apply the style.

Here is some reference for customizing the fonts with CSS.

3
  • Worked for me on Firefox 94.0.2, but since you need to set toolkit.legacyUserProfileCustomizations.stylesheets = true it will probably be removed in future
    – Leeroy
    Nov 25, 2021 at 13:19
  • this seems to be broken yet again. userChrome styles work but the document-matching selector apparently not anymore
    – phil294
    Jan 13 at 21:03
  • sorry, nevermind, it does work. I confused userChrome.css and userContent.css.
    – phil294
    Jan 13 at 21:44
6
+50

2019 answer:

If the Firefox Reader View can no longer be customized, you could use the alternative add-on Readability based Reader View, in order to "declutter webpages for better reading experience".

More information is to be found in its home page, from which I quote this text:

Q: Can I change the background color on the "Reader View" mode?

A: Yes, on the left side of the page, you will see a button with "Aa" label. Press this button once to open the UI control panel. You can change the font-family, font-size, line-height and the color of the page right from this panel. It is also possible to further customize each of the three provided modes by inserting your own user-defined custom styles. Use the options page to insert the CSS code.

In the settings for the extension, find "Custom styling (reader view)", custom CSS rules can be added here to override what font(s) are used when selecting serif/sans-serif in the GUI. Example:

body[data-font=serif] {
  font-family: 'My Serif Font', serif !important;
}

body[data-font=sans-serif] {
  font-family: 'My Sans-Serif Font', sans-serif !important;
}

You can also create rules that only apply for different background color settings, as per the documentation:

body[data-mode=sepia] {
  color: green !important;
}
body[data-mode=light] {
  color: blue !important;
}
body[data-mode=dark] {
  color: red !important;
}
3

There's a detailed description to do this by adding a userContent.css in your user profile at How to Customize Firefox Reader View for Better Readability (Hongkiat blog). Also see this Reddit thread, I want to edit chrome://global/skin/aboutReader.css How do I do it?

...\Profiles\<your-profile-folder>\chrome\userContent.css

There is also How can I add the CSS styles used by Firefox reader mode? on the Mozilla support forum which says to modify #moz-reader-content in:

chrome://global/skin/aboutReaderControls.css
chrome://global/skin/aboutReaderContent.css 

...but is silent on how to do that.

1
  • 4
    Please note that userChrome.css and userContent.css are disabled by default in firefox version 69 and newer. If this guide doesn't work for you, make sure that userContent is enabeld by going to about:config and search for toolkit.legacyUserProfileCustomizations.stylesheets and set it to true then restart your browser. ghacks.net/2019/05/24/…
    – Ramast
    Nov 26, 2019 at 12:51
3

Here's a way to do it based on matt wilkie's answer, for Linux systems (it should be similar for Windows and MacOS*):

$ cd ~/.mozilla/firefox/*.default
$ mkdir -p chrome && cd chrome
$ echo 'body.serif { font-family: "URW Palladio L" !important; }' >> userContent.css

(I used the "URW Palladio L" font for demonstration, as it's the closest font commonly available on Linux systems to Book Antiqua / Palatino, which are my go-to choices for serif text.)

The !important is required because the userContent.css stylesheet is loaded before the reader ones.

* To find the profile folder, navigate to about:support (or use the menu Help > Troubleshooting Information) and click the "Open Directory" button next to the "Profile Directory" entry.

1

If a page is available in Reader View, Reader mode will appear in the address bar. Options will appear to the left when you view a page in Reader View, and you have the Aa icon, click on it, and there you can change the font.

+

Install Reader 40.0 addon if you can't edit the font. With that addon, you can change it too.

4
  • 1
    thank you , but I know reader view what to do, I don't know how to change font reader view... I don't want install new add-on, I want change fonts of reader view.
    – Sinac
    Sep 21, 2015 at 9:33
  • Sorry mate, but I don't think it's possible without addon.
    – Josip Ivic
    Sep 21, 2015 at 9:38
  • ok, I agree with you, but I don't want install add-on for this job
    – Sinac
    Sep 21, 2015 at 9:42
  • Just try it, maybe it'll work out for you. You can uninstall it afterwards.
    – Josip Ivic
    Sep 21, 2015 at 9:43
1

I wondered why I didn't face this problem.

Turns out it's because I enforce my font preferences on all websites by unchecking the box in font preferences that says "Allow pages to choose their own fonts, instead of your selections above". Turns out this enforces this rule in the reader mode as well (which is good for accessibility).

This is not exactly what the original question is for, but I thought I'll leave this in case it's useful.

Allow pages to choose their own fonts, instead of your selections above

-1

These fonts are tied to your firefox font preferences. You can change them by going to Preferences > Content > Advanced and choosing your fonts for serif and sans-serif styles.

Screenshot of the Preferences view: Screenshot of the Preferences view

Screenshot of the changed Firefox reader font:

Screenshot of the changed Firefox reader font

As you can see in the images above, I have changed the serif font to Seravek.

2
  • 2
    At least in Firefox 47 those settings do not affect Reader View in any way. They only affect what the browser selects as the font when the CSS font-family evaluates to those four values. Jul 9, 2016 at 14:50
  • 2
    @ElmoAllén the preference settings will affect Reader View if "Allow pages to choose their own fonts..." is not checked. (Which still may not desirable since it affects all pages, not just reader view. It does provide an option which might work for some though.) Nov 15, 2016 at 17:11
-1

2022 (in Firefox 100):

  1. In the URL bar, enter: about:config . Click on Accept Risks and continue button
  2. In the search field, type reader This lists out all the parameters that can be configured including font type, content width, background color etc.

Once you choose the font type, you can edit the font by:

  1. In the browser url bar, type about:preferences
  2. scroll down the page until you see the Fonts section. Click on advanced and choose the required font.

Reference: https://www.trishtech.com/2022/04/how-to-change-fonts-in-mozilla-firefox-reader-mode/

1
  • typing in reader does NOT show configurable colors etc., only fixed scheme string values. And changing reader.font_type (which can also be done from the reader interface) does also NOT reveal any hidden settings that weren't there in the normal preferences dialog either. And the fonts section in the preferences does NOT allow changing the reader font.
    – phil294
    Jan 13 at 21:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .