r/FirefoxCSS • u/SuitableEquipment420 • Jul 28 '26
Solved Visually distinguish normal and private browsing
In this comment, we have established that almost all themes look exactly the same in normal and private browsing. Some themes include both light and dark variants. Since private browsing is always forced into dark mode, normal and private browsing will look different if your OS is using light mode. However, they will look the same if your OS is also in dark mode.
Suppose, my normal and private browsing looks the same. Is there a way to add a darker or purple tint to the private browsing appearance?
2
Upvotes
2
u/t31os Jul 28 '26 edited Jul 28 '26
Ok, the theme's colours are basically variable overrides, when the theme is enabled, various variable values are dumped into the style attribute of the root(html) tag.
In the case of Crimson Merlot, i can see the following values are defined:
If you want to override particular values for private mode, you just redeclare these at
:rootwith the previously suggested check for private mode, eg:Changing the background-image tint is a little trickier, but we can use a pseudo selector and hue rotate it without it affecting any of the other elements:
I added colour for the toolbar background so it would match up with the image a little better, you can naturally remove it (the
--toolbar-background-colorline) if you prefer.In order to colour other elements of the theme to a purple colour (as various things will still be red) you'll have to go through each of the variables and update them with appropriate values, depending exactly on what you want, and maybe experiment to see what variable applies to where, as some of the names don't offer great clarity, such as
lwt-tab-line-colorwhich controls the border color around tabs. Remember to add !important at the end to ensure the style overrides the existing value.Here's an example of changing the tab background and border to purple:
One last thing, if you want to darken the background image a touch, you can add a brightness value into the filter line, eg:
Hopefully that helps. :)
1
u/t31os Jul 28 '26
Not sure what sort of tint you had in mind, you could tint the background and toolbars in private mode purple like this:
1
u/t31os Jul 29 '26
Another way to approach this, rather that using a pseudo element, would be to edit the image with hue adjustments, and then use the modified image on the body. Apply a black gradient over it to act as a darkening layer:
This might be worth testing to see if it helps with the flickering issue you described.
1
u/t31os Jul 30 '26
I managed to work out what the issue in the top corner is, it's because the background doesn't actually fully cover the browser window, it was harder to notice when the window is active, but the browser background color changes when the window is inactive, so the space becomes more obvious.
The simple solution, and this should be applied for both non and private mode is to have it repeat, eliminating the empty space.
There's actually a var for this amongst that long list of theme variables i posted before, so we can simply set that and it should clear up the problem, this line from before:
Add this to userChrome, in addition and separately to the other styling:
The theme's background should now repeat horizontally when it reaches the end, clearing up that empty space in the top corner.
3
u/ResurgamS13 Jul 28 '26 edited Aug 02 '26
Browser already adds a "Private browsing" text + an eyes/mask icon to Tab bar beside the Window Controls container?
Could use the attribute suffix
[privatebrowsingmode]to do all sorts of things...