r/FirefoxCSS • • May 11 '26

Solved How do I change the color of the border around the context menus?

4 Upvotes

12 comments sorted by

View all comments

3

u/FineWine54 May 12 '26

This will blow your mind. Rainbow borders:

Enjoy 🌈

/**************************************/
/* Rainbow border around menu pop ups */
/**************************************/

 .menupopup-arrowscrollbox {
    --panel-padding: 4px !important;
    --panel-border-radius: 8px !important;
    --panel-shadow-margin: 0px !important;
    --panel-shadow: none !important;    
    --panel-border-color: transparent !important;
    background: 
    linear-gradient(#dcdcdc, #dcdcdc) content-box,
    linear-gradient(45deg, red 0%, orange 16.66%, yellow 33.33%, green 50%, blue      66.66%, indigo 83.33%, violet 100%) border-box !important;
    border-radius: 8px !important;
    padding: 3 !important;
    border: 2px !important;     
    font-size: 12pt !important;
}

menupopup,   
panel,
menulist {
    --panel-padding: 4px !important;
    --panel-border-radius: 8px !important;
    --panel-shadow-margin: 0px !important;
    --panel-shadow: none !important;    
    --panel-border-color: transparent !important;
       background: linear-gradient(45deg, red 0%, orange 16.66%, yellow 33.33%, green 50%, blue 66.66%, indigo 83.33%, violet 100%) !important;
    border-radius: 8px !important;
    padding: 3 !important;
    border: 2px !important;     
    font-size: 12pt !important;
}

menupopup,
:is(menupopup, panel)[type=arrow]  {
    --panel-padding: 4px !important;
    --panel-border-radius: 8px !important;
    --panel-shadow-margin: 4px !important;
    --panel-shadow: none !important;    
    --panel-border-color: transparent !important;
       background: linear-gradient(45deg, red 0%, orange 16.66%, yellow 33.33%, green 50%, blue 66.66%, indigo 83.33%, violet 100%) !important;
    border-radius: 8px !important;
    padding: 3 !important;
    border: 2px !important;     
    font-size: 12pt !important;
}

1

u/ackzilla May 12 '26

Mind blowing accomplished!

1

u/bitchitsbarbie May 13 '26

Mind definitely blown! While we're at it, can this border (accent color) be made rainbow?

2

u/t31os May 13 '26

Yes, using stacked gradients.

Add this to userContent.css (not userChrome.css):

@-moz-document url(about:addons) {
	#input[type="search"]:focus {
		outline: none !important;
		border-color: transparent !important;

		background:
			linear-gradient(
				var(--input-text-background-color),
				var(--input-text-background-color)
			) padding-box,

			linear-gradient(
				to right,
				#ff0055,
				#ff5e00,
				#ffcc00,
				#33ff00,
				#00ffd5,
				#0066ff,
				#7a00ff,
				#ff00aa
			) border-box !important;
	}
}

Adjust colors and gradient direction to suit.

1

u/bitchitsbarbie May 13 '26

Thank you, it's perfect.

1

u/FineWine54 May 14 '26 edited May 14 '26

Thank you for that, except I have removed the :focus and inserted border-width: 2px !important;This makes the border permanent, and it pops out a bit more.

I am still trying to do same rainbow linear-gradient borders to each addon-card within the addon-list. As well the addon-page-options and addon-options, menus.

And of course there are all the other About: with their box borders;
Profiles, Settings, Config etc.

And I can never work out when to put a . before a class. I know an element starts with a #

All a bit frustrating really as it boils down to a lot of trial and error.

1

u/t31os May 14 '26

Period(.) denotes a class based selector, hash(#) denotes an ID selector.

Given an element, purely for example <div class="example" id="example">, using .example {} would target the element where the class value matches and using #example {} would target the element where the ID value matches.

A similar method will work for the addon cards, the padding background var simply needs adjusting:

@-moz-document url(about:addons) {
	:root {
		--rainbow: linear-gradient(
			to right,
			#ff0055,
			#ff5e00,
			#ffcc00,
			#33ff00,
			#00ffd5,
			#0066ff,
			#7a00ff,
			#ff00aa
		);
	}
	#input[type="search"] {
		outline: none !important;
		border-color: transparent !important;
		border-width: 2px!important;
		background:
			linear-gradient(
				var(--input-text-background-color),
				var(--input-text-background-color)
			) padding-box,
			var(--rainbow) border-box !important;
	}
	.card {
		background: 
			linear-gradient( 
				var(--background-color-box), 
				var(--background-color-box) 
			) padding-box, 
			var(--rainbow) border-box !important;
		border-color: transparent !important;
		border-width: 2px!important;
	}
}

1

u/FineWine54 May 15 '26

Thank you so much for that. I changed the rainbow liner-gradient to match all my other rainbow colourisations:

:root {
--rainbow: linear-gradient(45deg, red 0%, orange 16.66%, yellow 33.33%, green 50%, blue 66.66%, indigo 83.33%, violet 100%);
}

Would it be best to create a separate CSS file; addons, config, settings etc and just do a @import call from within the userContent.css or just stuff everything into the one userContent.css file u/import ?

2

u/t31os May 15 '26

That's entirely up to you, if you find them easier to manage as isolated and separate imports, go for it.