In Mozilla Firefox, I want to create userContent.css which overrides the CSS of a site.
Where should I create the file (Windows 7)?
In Mozilla Firefox, I want to create userContent.css which overrides the CSS of a site.
Where should I create the file (Windows 7)?
Open Firefox and press Alt to show the top menu, then click on Help → Troubleshooting Information
Click the Open Folder button beside the Profile Folder entry
Create a folder named chrome in the directory that opens
In the chrome folder, create a CSS file with the name userContent.css
Copy the following code to userContent.css, replacing "example.com" with the website you want to modify and your own custom CSS. The !important is important.
@-moz-document domain(example.com) {
img { opacity: 0.05 !important; }
}
Open another tab in Firefox, go to about:config, and set toolkit.legacyUserProfileCustomizations.stylesheets preference to true.
Restart Firefox.
about:support and in my Firefox (v20 nightly build on Ubuntu) it has an entry named "Profile directory" with a button "Open Directory" which opens up the profile directory /home/tripleee/.mozilla/firefox/asdf1234.default/ in Nautilus.
– tripleee
Jan 03 '13 at 10:38
@-moz-document domain("...") to apply the style to every pages.
– Nicolas
May 30 '13 at 08:26
chrome could also contain userChrome.css, which would style the browser interface ("chrome").
– sam
Sep 27 '14 at 18:05
userContent.css should only be the fully CSS portable ones: /* */. For example, # will not work and will break it in unpredictable ways.
– Peter Mortensen
Jul 18 '18 at 08:33
toolkit.legacyUserProfileCustomizations.stylesheets preference to true due to https://bugzilla.mozilla.org/show_bug.cgi?id=1541233
– ThomasR
Sep 18 '19 at 12:44
toolkit.legacyUserProfileCustomizations.stylesheets to true (at this URL: about:config). Then restart Firefox.
– zenekpiwko
Dec 28 '19 at 14:23
about:profiles you have the button to open your profile folder and a restart button to check if it works. Setting legacyUserProfileCustomizations beforehand is important, though.
– twigmac
Jan 29 '20 at 22:44
@-moz-document domain(example.com) is for, it limits the enclosed CSS to only the domains listed between the brackets.
– klaar
May 17 '20 at 09:41
!important doesn't work or doesn't work the usual way. I tried to change font-family, and in the Developer Tools it showed that font-family was overridden, but in reality it used the original font. Resolved it by making the selector more specific.
– x-yuri
Mar 12 '22 at 04:01
There was an old extension called ChromEdit, which added a simple button to easily open user CSS for editing.
This was apparently compromised or withdrawn. Stylish was an alternative, but similarly this now appears to be defunct.
At the moment you just have to remember where the file is supposed to go.
<style> into DOM, i. e. they modify author stylesheet rather than user one. This is indeed a broken design, which makes it harder to use.
– Dmitry Alexandrov
Jan 26 '19 at 15:15
Stylus (4.6 stars, recommended by Firefox): https://addons.mozilla.org/en-GB/firefox/addon/stylish/
Both are still available. I'd go with Stylus.
I can also highly recommend Midnight Lizard for creating dark or tinted looks. https://addons.mozilla.org/en-GB/firefox/addon/midnight-lizard-quantum/
– trebor Oct 26 '22 at 09:55
userContent.css) – Peter Mortensen Jan 03 '20 at 23:50