Firefox
You can do this by editing (or creating if it is not there) the file userContent.css
. Its location depends on the platform (the parent folder can also be found in menu Help → "Troubleshooting Information" → section "Application Basics" → field "Profile Folder"):
Linux
$HOME/.mozilla/firefox/[xyz].default-release/chrome/userContent.css
Windows
Depending on the Windows version and other configuration, userContent.css
is in one of the following folders:
C:\Documents and Settings\[username]\Application Data\Mozilla\Firefox\Profiles\[xyz].default\chrome
.
C:\Users\[username]\AppData\Roaming\Mozilla\Firefox\Profiles\[xyz].default\chrome
(more generally, it is %APPDATA%\Mozilla\Firefox\Profiles\[xyz].default\chrome
).
Common for Linux and Windows
You may have to create the chrome
subdirectory and the file userContent.css
.
Add these lines to that file to change the colors (obviously, you can change the actual colors used to whatever you prefer - e.g. using Paletton Live Colorizer):
a { color: #333388!important; } /* Unvisited link color */
a:visited { color: #333340!important; } /* Visited link color */
In most cases Firefox has to be restarted before it takes effect.
Also, for later version of Firefox (69 and later), check that toolkit.legacyUserProfileCustomizations.stylesheet in about:config is true. In some cases it is automatically set to true when file userContent.css
is created, but that is not always the case.
Chrome
You can do the same for Chrome by editing $HOME/.config/google-chrome/Default/User\ StyleSheets/Custom.css
which on Windows, is located at %USERPROFILE%\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\Custom.css
.
Related (to the accepted answer): How can I override the CSS of a site in Firefox with userContent.css?
– Peter Mortensen – 2019-11-17T01:26:38.170Similar for Thunderbird (using the same files, for font size): How can I change the font size of a Thunderbird thread list on a Mac?
– Peter Mortensen – 2020-01-04T00:40:30.593