r/FirefoxCSS • • 21h 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..

2 Upvotes

8 comments sorted by

1

u/t31os 10h 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 7h 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?

1

u/t31os 6h ago edited 5h 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 5h ago

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

1

u/t31os 5h 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 5h ago

Yep!

1

u/t31os 4h 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/ResurgamS13 18h ago

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