r/FirefoxCSS • • 4d ago

Solved Need help changing this.

Post image

I need help on how to change this button purple background color.

Thanks in advance.

3 Upvotes

12 comments sorted by

3

u/t31os 4d ago

Adjust as needed:

#commonDialogWindow {
	--button-background-color-primary: red !important;
	--button-border-color: transparent !important;

	--button-background-color-primary-hover: yellow !important;
	--button-border-color-primary-hover: transparent !important;
	
	--button-background-color: green !important;
	--button-border-color: transparent !important;
	
	--button-background-color-hover: blue !important;
	--button-border-color-hover: transparent !important;
}

2

u/strok3 3d ago

Thanks for the support, but still that sneaky purple shows when you click either button.

2

u/t31os 3d ago

Style the active state also, eg:

--button-background-color-primary-active: orange !important;
--button-background-color-active: orange !important;

2

u/strok3 3d ago

You are the man!

1

u/FineWine54 3d ago

Thank you for that. BUT here is a curve ball. So far I have set mine up as follows:

NOTE: I have also included the #commonDialog element as well.

#commonDialogWindow,
#commonDialog {    
--button-background-color-primary: red !important;
--button-background-color-primary-hover: green !important;
--button-border-color-primary-hover: transparent !important;
--button-background-color: green !important;
--button-background-color-hover: red !important;
--button-border-color-hover: transparent !important;
--button-text-color: white !important;
}

So as you can see "Cancel" is green and then red on hover and "Close Tabs" red and then green on hover.
What I would like is that PLUS when "Cancel" is hovered over the "Close Tabs" changes to green and when "Close Tabs" is hovered over "Cancel" changes to red.

Hope that makes sense

1

u/t31os 3d ago

That's certainly a strange request, but give this a try:

#commonDialogWindow,
#commonDialog {

	--mycolor1: red;
	--mycolor2: green;

	--button-background-color-primary: var(--mycolor1) !important;
	--button-background-color-primary-hover: var(--mycolor2) !important;
	--button-border-color-primary-hover: transparent !important;
	--button-background-color: var(--mycolor2) !important;
	--button-background-color-hover: var(--mycolor1) !important;
	--button-border-color-hover: transparent !important;
	--button-text-color: white !important;

}

.dialog-button-box:has(button[dlgtype="accept"]:hover) > button[dlgtype="cancel"] {
	--button-background-color: var(--mycolor1, revert-rule) !important;
}
.dialog-button-box:has(button[dlgtype="cancel"]:hover) > button[dlgtype="accept"] {
	--button-background-color-primary: var(--mycolor2, revert-rule) !important;
}

2

u/FineWine54 3d ago

Well ain't you a very clever bunny πŸŽ“πŸ°πŸ˜† That works perfectly. I would never have got that.πŸ€·β€β™‚οΈ Thank you very much.πŸ‘

→ More replies (2)

1

u/Ryo-ryomac 3d ago

Excuse me.

Could you please help me with something ?

I’m not a fan of the purple Accent Color either.

I was able to change the color using CSS, but I’m having trouble because I can’t identify the specific element for the text color.

The text for the "Close tabs" button and "Quit Firefox" is black; when I change the background color, the text becomes difficult to read.

Could you please teach me which elements control the text color for the "Close tabs" button and "Quit Firefox"

2

u/t31os 3d ago
/* Primary button */
--button-text-color-primary: YOURCOLOR !important;
/* Other buttons */
--button-text-color: YOURCOLOR !important;

2

u/Ryo-ryomac 3d ago

Thank you for your prompt response.

Your advice solved the issue.

Thank you so much β€” I truly appreciate it.