[solved] change default tab width?
-
- Posts: 40
- Joined: August 11th, 2018, 6:09 am
[solved] change default tab width?
I know about changing the minimum tab width. I want to set the default (or max, I guess) tab width because sometimes I'll just have a couple of tabs but the title of the page goes past the tab. In userChrome, I tried:
.tabbrowser-tab:not([pinned]) {max-width: 350px !important;}
didn't do anything. Thanks.
.tabbrowser-tab:not([pinned]) {max-width: 350px !important;}
didn't do anything. Thanks.
Last edited by pleasejust on December 12th, 2018, 4:01 am, edited 1 time in total.
- smsmith
- Moderator
- Posts: 19979
- Joined: December 7th, 2004, 8:51 pm
- Location: Indiana
Re: change default tab width?
I think you want to do it the other way around. You need to use min-width to make the tab larger (which is what it sounds like you are trying to do).
Give a man a fish, and he eats for a day. Teach a man to fish, and he eats for a lifetime.
I like poetry, long walks on the beach and poking dead things with a stick.
Please do not PM me for personal support. Keep posts here in the Forums instead and we all learn.
I like poetry, long walks on the beach and poking dead things with a stick.
Please do not PM me for personal support. Keep posts here in the Forums instead and we all learn.
- RobertJ
- Moderator
- Posts: 10880
- Joined: October 15th, 2003, 7:40 pm
- Location: Chicago IL/Oconomowoc WI
Re: change default tab width?
.
I think this is what you want
Set the width to whatever you want.
.
I think this is what you want
Code: Select all
.tab-content {
min-width: 400px !important;
}
.
FF 92.0 - TB 78.13 - Mac OSX 10.13.6
- jscher2000
- Posts: 11770
- Joined: December 19th, 2004, 12:26 am
- Location: Silicon Valley, CA USA
- Contact:
Re: change default tab width?
Hmm, I think your rule should work. Do your other rules in userChrome.css work?
The default max-width is 225px. As more tabs are added, it is reduced to no lower than the min-width. The Browser Toolbox Inspector shows me this rule:
The -moz-box-flex: 100; seems to make the tab expand to the max-width if there is space on the bar, so increasing the max-width should work.
I tested this in the Browser Toolbox Style Editor, following my other userChrome.css rules, and it makes enormous tabs:
The default max-width is 225px. As more tabs are added, it is reduced to no lower than the min-width. The Browser Toolbox Inspector shows me this rule:
Code: Select all
.tabbrowser-tab:not([pinned]) {
-moz-box-flex: 100;
max-width: 225px;
min-width: var(--tab-min-width);
width: 0;
transition: min-width 100ms ease-out,
max-width 100ms ease-out;
}
I tested this in the Browser Toolbox Style Editor, following my other userChrome.css rules, and it makes enormous tabs:
Code: Select all
/* Wider tabs when space is available */
.tabbrowser-tab:not([pinned]) {
max-width: 400px !important; /* default is 225px */
}
-
- Posts: 40
- Joined: August 11th, 2018, 6:09 am
Re: change default tab width?
no, I want min-width to be smaller in the case when I have many tabs open at once. I need the default size of the tab to be larger when there is space.
Thanks, jscher. hm, my code should work eh? I don't know. I'll try putting it at the top of userChrome/fiddling with it and report back, thanks.
Thanks, jscher. hm, my code should work eh? I don't know. I'll try putting it at the top of userChrome/fiddling with it and report back, thanks.
-
- Posts: 40
- Joined: August 11th, 2018, 6:09 am
Re: change default tab width?
ok, so... for some reason when I place the code at the top of userChrome, it works I guess. Who knows... so, that's:
.tabbrowser-tab:not([pinned]) {
max-width: 325px !important;
}
Some wonky behavior is observed, though, when I use this code in conjunction with setting browser.tabs.closeWindowWithLastTab to false in about:config. Basically this: https://pasteboard.co/HQHQCFI.png. When I open more than one tab, then eventually go back to closing the tabs, closing the final tab will result in the tab going crazy and repositioning itself on the tab bar. As a test you can cmd/ctrl-t a few times, then cmd/crtl-w a bunch of times and you'll see this in action. I guess this is a bug. Closing/reloading the fx window resets the tab position to it's proper place.
.tabbrowser-tab:not([pinned]) {
max-width: 325px !important;
}
Some wonky behavior is observed, though, when I use this code in conjunction with setting browser.tabs.closeWindowWithLastTab to false in about:config. Basically this: https://pasteboard.co/HQHQCFI.png. When I open more than one tab, then eventually go back to closing the tabs, closing the final tab will result in the tab going crazy and repositioning itself on the tab bar. As a test you can cmd/ctrl-t a few times, then cmd/crtl-w a bunch of times and you'll see this in action. I guess this is a bug. Closing/reloading the fx window resets the tab position to it's proper place.
- jscher2000
- Posts: 11770
- Joined: December 19th, 2004, 12:26 am
- Location: Silicon Valley, CA USA
- Contact:
Re: change default tab width?
If rules work at one place in userChrome.css and not another, there may be a problem with a missing } at the end of a rule. Do you use an editor that highlights the ending } or ] when you select the beginning one? Very handy.
As for the issue of the tab moving when you close the last time and Firefox opens a New Tab, I have no idea why the width of the tab should make any difference.
As for the issue of the tab moving when you close the last time and Firefox opens a New Tab, I have no idea why the width of the tab should make any difference.
-
- Posts: 40
- Joined: August 11th, 2018, 6:09 am
Re: change default tab width?
turns out setting max-width to anything but default is just buggy and doesn't work right regardless of anything else. Closing and opening tabs at random will result in misaligned newly created tabs. Just looking at about:config there is no tabmaxwidth entry. There is tabminwidth as we all know. Is it sufficient to submit feedback or should I make a bug report? I can't imagine mozilla don't know about this...
Last edited by pleasejust on December 9th, 2018, 5:13 pm, edited 1 time in total.
- Frank Lion
- Posts: 21178
- Joined: April 23rd, 2004, 6:59 pm
- Location: ... The Exorcist....United Kingdom
- Contact:
Re: change default tab width?
Neither will result in any change. If you get an answer at all you'll be told that they are not responsible for the behaviour of your non-default coding, which is hotly discouraged by them.pleasejust wrote:Is it sufficient to submit feedback or should I make a bug report? I can't imagine mozilla don't know about this.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
.
-
- Posts: 40
- Joined: August 11th, 2018, 6:09 am
Re: change default tab width?
That's ludicrous. max-width should be seen as a personal preference, like color. Especially with high res displays, 4k, etc. I mean, why would firefox even act out just because max-width is changed. It can't be that hard to fix it and make some people happy. It's like they have no sense of inclusivity:effort ratio at Mozilla. Is there a way to figure out what's causing this behavior in the source code and fix it?
-
- Posts: 97
- Joined: March 7th, 2015, 4:19 pm
- Location: Japan
Re: change default tab width?
FYI
Bug 629880 - Custom tab sizes in UserChrome.css breaks the tab bar
It is still reproducible on Firefox 63.0.3(Win10/LoDPI).
As comment 6 noted
>Had the same issue too, but solved it with browser.tabs.animate = False
This behaviour seems to be gone with toolkit.cosmeticAnimations.enabled = false
(browser.tabs.animate was removed as of v55)
Bug 629880 - Custom tab sizes in UserChrome.css breaks the tab bar
It is still reproducible on Firefox 63.0.3(Win10/LoDPI).
As comment 6 noted
>Had the same issue too, but solved it with browser.tabs.animate = False
This behaviour seems to be gone with toolkit.cosmeticAnimations.enabled = false
(browser.tabs.animate was removed as of v55)
-
- Posts: 40
- Joined: August 11th, 2018, 6:09 am
Re: change default tab width?
Yes, thanks altanto! Brilliant, man. This works, can't thank you enough!
-
- Posts: 97
- Joined: March 7th, 2015, 4:19 pm
- Location: Japan
Re: change default tab width?
Umm...
Unfortunately, the behaviour seems to be caused by "!important"...
If I modified the style in browser.css itself instead of userChrome.css, tab mis-position doesn't occur.
(It means the user disturbed the bahaviour of Firefox, at least from a view of firefox-side.(I'm not a developer though))
So, userChrome.css like this should work.(whatever toolkit.cosmeticAnimations.enabled is)(am not considering other side-effects)
Unfortunately, the behaviour seems to be caused by "!important"...
If I modified the style in browser.css itself instead of userChrome.css, tab mis-position doesn't occur.
(It means the user disturbed the bahaviour of Firefox, at least from a view of firefox-side.(I'm not a developer though))
So, userChrome.css like this should work.(whatever toolkit.cosmeticAnimations.enabled is)
Code: Select all
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
.tabbrowser-tab:not([pinned]) {
max-width: 325px !important;
}
.tabbrowser-tab:not([pinned]):not([fadein]) {
max-width: 0.1px !important;
}
-
- Posts: 40
- Joined: August 11th, 2018, 6:09 am
Re: [solved] change default tab width?
Interesting. I'm fine with the animations off. At least this post is here for reference. Thanks.