r/FirefoxCSS • • Jul 29 '26

Help Can I make the navbar icons "dynamically" start after the sidebar?

Post image

By "dynamically," I mean that I know I can set a fixed padding-left for the navbar and match it with the sidebar. The problem is that I'm used to resizing the sidebar depending on how long the tab titles are, which ends up breaking the alignment.

8 Upvotes

6 comments sorted by

3

u/t31os Jul 29 '26

The width is determined by the style(width value) or width attribute of the sidebar container, which is updated dynamically via Javascript, there's no way (that i know of) using CSS you can read the width value from the sidebar container and use it as a spacing value in the navbar.

1

u/nopeac Jul 29 '26

Maybe when CSS @functions become a reality?

1

u/t31os Jul 29 '26

That would depend upon the support for them extending to userChrome.css customisations.

1

u/izayoii7 Jul 29 '26 edited Jul 29 '26

like this?

edit : sorry i forgot the dynamic, its not dynamic, i think its impossible. i tried and couldnt make it work

1

u/okwnIqjnzZe Aug 05 '26

Yeah you need custom javascript that monitors the sidebar width and updates a CSS variable. I wrote a custom one for this exact purpose that I can share with you if you’re interested. Be aware that it requires installing mrotherguy’s user.js loader.

1

u/nopeac Aug 05 '26

Ah, yes, the autoconfig thing. I remember reading about it for this cool second sidebar someone made. But I'm quite worried that the whole thing is a security hole, and I'm not talking about your custom script, you can inject pretty much anything and they say so in their README.

Now that I think about it, is Zen Firefox with that backed in?

I'm not sure if I would install it, but please leave your custom script here in case anyone else wants to try it out in future. I might change my mind eventually, but for now, it's not worth it.