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.

  • MrOtherGuyM
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    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@fedia.ioOP
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      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)?

      • MrOtherGuyM
        link
        fedilink
        arrow-up
        2
        ·
        3 years ago

        Yes, simply using not operator with the condition:

        @supports not -moz-bool-pref("userchrome.my-pref.enabled"){
          #nav-bar{ background: #f00 !important; }
        }
        

        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@fedia.ioOP
          link
          fedilink
          arrow-up
          1
          ·
          3 years ago

          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)?

          • MrOtherGuyM
            link
            fedilink
            arrow-up
            2
            ·
            3 years ago

            @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@fedia.ioOP
              link
              fedilink
              arrow-up
              1
              ·
              3 years ago

              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.