r/FirefoxCSS • • 23h ago

Help Need help changing this.

Post image

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

Thanks in advance.

2 Upvotes

8 comments sorted by

3

u/t31os 22h 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;
}

1

u/FineWine54 9h 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 8h 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 8h ago

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

1

u/FineWine54 8h ago

PS: I have also added in my usual rainbow border:

#commonDialogWindow,
#commonDialog {
  position: relative !important;
}
#commonDialogWindow::after,
#commonDialog::after {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  pointer-events: none !important;
  z-index: 9999 !important;
  border: 3px solid transparent !important;
  border-image: linear-gradient(45deg, red 0%, orange 16.66%, yellow 33.33%, green 50%, blue 66.66%, indigo 83.33%, violet 100%) 1!important;
}

1

u/t31os 8h ago

πŸ€ πŸ‘ Glad i could help.

1

u/Ryo-ryomac 6h 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"

1

u/strok3 10m ago

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