Vertical tabs on right

Hi. I've been experimenting with MrOtherGuy's vertical tabs script. I found that the tab bar could be moved to the right side of the window with just two simple changes:

change line 19 from: margin-left: var(--uc-vertical-tabs-width); to margin-right: var(--uc-vertical-tabs-width);
and

change line 31 from: left: 0; to right: 0;
Works for me.

MrOtherGuy Mod ,

Indeed. Would make sense to have a pref to toggle that. And what do you know, now there is! Thanks for the idea :)

mrqwerky OP ,

Great, thanks!

mrqwerky OP ,

Line 39: @media (-moz-bool-pref: "userchrome.vertical-tabs.on-right.enabled"){
This line doesn't work for me, even though I have set that preference. If I comment out this line (and its closing brace), then the code block does work correctly--it just doesn't recognize the preference. Could it be because I'm testing on FF 115 ESR?

In multi-row_tabs_below_content.css (a commit from June) this line:
Line 239: @supports -moz-bool-pref("userchrome.multirowtabs.static-menubar.enabled"){
and its code block do work correctly for me.

Back to vertical_tabs.css, I tried using @supports instead of @media, and that did work.

MrOtherGuy Mod ,

-moz-bool-pref used a as media query requires Firefox 120. It should work totally fine in ESR 115 if you make it a @supports query instead.

mrqwerky OP ,

It does. Is there a way to query a preference to determine whether it is 0, 1, 2, 3 etc.?

MrOtherGuy Mod ,

No. I know it would be super useful for some things, but there is no such thing.

mrqwerky OP ,

That's what I suspected. Is it just possible that a boolean preference can be tested to be true or tested to be false?

MrOtherGuy Mod ,

Well, boolean cannot have any other values except for true and false - it wouldn’t be a boolean if it did. Although there’s sort of a third option as “pref doesn’t exist” but the false category includes that.

mrqwerky OP ,

So, a @supports can query whether a preference is true. Can it also query whether a preference is false (or doesn't exist)? So, could we have a block that executes only when a preference is false (or doesn't exist)?

MrOtherGuy Mod ,

Yes, simply using not operator with the condition:


<span style="color:#323232;">@supports not -moz-bool-pref("userchrome.my-pref.enabled"){
</span><span style="color:#323232;">  #nav-bar{ background: #f00 !important; }
</span><span style="color:#323232;">}
</span>

Small caveat though, since @supports tests whether the condition is supported, it also resolves to false if the browser doesn’t support the condition type. So if -moz-bool-pref() function is not supported (as is with Firefox 120 and above) then the condition is false. And thus, if you use negation then whole expression resolves to true.

That means that the above expression will always apply red background to nav-bar in Firefox 120 but in older Firefox version only apply it if that pref doesn’t exist or exists but is set to false

You can read all about @supports at MDN although it doesn’t list the Firefox internal-only -moz-bool-pref condition.

mrqwerky OP ,

Yikes! So -moz-bool-pref() has been removed in FF 120? Why would they do that? Is there are replacement?

So in FF < 120, one could effectively create an IF-THEN-ELSE with @supports -moz-bool-pref(test_condition) and @supports not -moz-bool-pref(test_condition)?

MrOtherGuy Mod ,

@supports based -moz-pref is indeed removed. But it is replaced with a media query based method, which is much nicer since it can then among other things respond to pref changes without having to restart Firefox.

mrqwerky OP ,

Oh, that's much better--to be able, for example, to toggle the vertical tabs left or right side without restarting!

Thanks for the explanation and the link. That resource should prove very helpful.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • FirefoxCSS
  • kamenrider
  • Rutgers
  • MidnightClan
  • Lexington
  • cragsand
  • mead
  • RetroGamingNetwork
  • mauerstrassenwetten
  • loren
  • xyz
  • PowerRangers
  • AnarchoCapitalism
  • WatchParties
  • itdept
  • supersentai
  • neondivide
  • steinbach
  • AgeRegression
  • WarhammerFantasy
  • Teensy
  • learnviet
  • bjj
  • electropalaeography
  • space_engine
  • khanate
  • jeremy
  • Mordhau
  • fandic
  • All magazines