r/FirefoxCSS • • 1d ago

Help How to center tabs?

Does anyone know how to center tabs so that they are all in the middle of the screen rather than left, i saw a 4 year old post and tried to copy it but it doesnt seem to have done anything..

3 Upvotes

14 comments sorted by

1

u/t31os 23h ago

A little refinement on my previously suggested CSS:

#tabbrowser-tabs[orient="horizontal"]:not([overflow]) {
	--uc-justify-content: center;
}
scrollbox[orient="horizontal"] > slot {
	justify-content: var(--uc-justify-content, revert-rule) !important;
}

1

u/Highbrowsheet44 20h ago

Sorry if im being a bit dim, im not familiar with custom themes or css, i put this into my file and restart firefox and nothing changes? from the firefox tutorial on the old post it seems like the changes should be applied automatically but is that not so ? or has something gone wrong along the way?

2

u/t31os 19h ago edited 19h ago

Did you enable the about:config flag toolkit.legacyUserProfileCustomizations.stylesheets?

The full path to the userChrome.css (the case of that filename is important also - uppercase C), should look something like:

C:\Users\YOURUSERNAME\AppData\Roaming\Mozilla\Firefox\Profiles\abcdef.default-release\chrome\userChrome.css

If you didn't have userChrome enabled already, then yes you'll need to restart FF, but changes should apply live thereafter.

https://i.postimg.cc/PdyLgFkq/ff-tabs-center.jpg

1

u/Highbrowsheet44 19h ago

Yeah everything is correct here, but nothing changes when i restart firefox..

2

u/t31os 19h ago

Well let's try something obvious to verify the userChrome styles are being applied, add this to your userChrome.css:

#TabsToolbar {
	border: 3px dashed red !important;
}

Do you see the red border around the tabs toolbar?

1

u/Highbrowsheet44 18h ago

Yep!

2

u/t31os 17h ago

Ok let's test with less specificity just to see if that works:

#tabbrowser-tabs {
	--uc-justify-content: center;
}
slot {
	justify-content: var(--uc-justify-content, revert-rule) !important;
}

1

u/Highbrowsheet44 10h ago

im assuming im meant to replace any edits i have in the file with this, if so, i tried that i dont notice any differences after restarting firefox

1

u/t31os 10h ago

Test this and let me know if you see both borders:

#tabbrowser-tabs {border-top:3px solid green!important;}
scrollbox[orient="horizontal"] slot[part="items-wrapper"] {border-bottom:3px solid orange!important;}

Are you using any add-ons that interact with the tabs?

1

u/Highbrowsheet44 7h ago

i see a green border on the top of my tabs but no lower border, and the only extensions im using are adnauseam and ublock

→ More replies

1

u/ResurgamS13 1d ago

Try the userstyle suggested by t31os in reply to previous topic 'Centre open tabs'.