MrOtherGuy / firefox-csshacks

Collection of userstyles affecting the browser
Mozilla Public License 2.0
3.24k stars 315 forks source link

glitch fix and cosmetic improvement #352

Closed sonofevil closed 6 months ago

sonofevil commented 6 months ago

fix: rule briefly failed to apply when opening new tab improvement: divider alignment

sonofevil commented 6 months ago

Uncertain whether the cosmetic fix will look good in all themes. The dividers are weird .tab-stack::before pseudo-elements, not actual dividers. Whether they look centered depends on the default padding. I tried directly styling them with userChrome.css, but it seems to get ignored.

MrOtherGuy commented 6 months ago

What dividers are you talking about? Tabs don't have any dividers in Firefox normally. I don't think that the margin-right: -5px rule is ever going to be applied anyway, because tabs.css line 86 defines margin for .tabbrowser-tab which is always going to override that rule. The link is for mozilla-central (nightly), but release Firefox also has a similar rule.

Applying zero-padding also overflowing pinned tabs might be a good idea though. Both are kinda janky, but I guess this is less janky than pinned tabs suddenly getting wider when overflow happens.

sonofevil commented 6 months ago

The theme with the dividers is "System theme — auto 1.3", the default theme on my installation but they also appear in other themes I've tried. It's possible that this is somehow Linux-specific.

The rule is

  @supports -moz-bool-pref("userChrome.tab.static_separator")
.tab-stack::before, .tab-stack::after {
  display: block;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 0px;
  height: 100%;
  border-right: 1px solid var(--toolbarseparator-color);
}

It's in chrome://browser/skin/userChrome.css.

It looks like this: Screenshot_20240325_170527

You are right that there is another rule overriding it. On my first test it worked but after reload it doesn't. Is there any reason not to use !important here?

sonofevil commented 6 months ago

Hm, I need to tweak this, it looks pretty bad. I'll take it out of the pull request.

MrOtherGuy commented 6 months ago

Yeah, maybe you have old Firefox version like ESR or something, because @supports -moz-bool-pref(some_pref) hasn't worked since Firefox 120 - there is a media-query version of it nowadays. That would also explain why you see different behavior. Or perhaps your package-manager uses modified Firefox.

The target is Firefox built by Mozilla, which indeed also has some OS specific rules, but I don't think that's the case here.

MrOtherGuy commented 6 months ago

Right, but let's indeed make also overflowing pinned tabs get smaller, I think that's good. Thanks!