Timvde / UserChrome-Tweaks

A community maintained repository of userChrome.css tweaks for Firefox
GNU General Public License v3.0
1.25k stars 121 forks source link

Compact find bar overlaps sidebar when moved to right #44

Closed Keith94 closed 6 years ago

Keith94 commented 6 years ago

Regarding the style: compact-findbar-on-top.css

image

Madis0 commented 6 years ago

That is a bit hard to fix, since the position is fixed and even if I somehow set a second position for when sidebar is opened, you can adjust sidebar's width too, making it still "break".

As a workaround, I would suggest setting right: 1em; to a value you prefer, such as 19em.

Timvde commented 6 years ago

Alternatively, would left: 1em move it to the top left?

Madis0 commented 6 years ago

In that case, one can remove that line entirely (default is left with zero margin).

Timvde commented 6 years ago

I suppose that there is no way to check in CSS whether the sidebar is open, and on which side it is?

Madis0 commented 6 years ago

I guess it might be, but I don't have the time/tools to find out at the moment.

Madis0 commented 6 years ago

I have now found out that there is a parameter called ordinal that says whether the sidebar is on the left or right, so as an example one could do this:

#sidebar-box[ordinal="2"]{ /* red if left */
  background-color: red !important;
}

#sidebar-box[ordinal="4"]{ /* green if right */
  background-color: green !important;
}

Only question is, how to use that to adjust the find bar? Something like

#sidebar-box[ordinal="4"] > .browserContainer > findbar {
  left: 0em !important;
}

didn't do the trick.

Timvde commented 6 years ago

I think some magic with the :has selector could do the trick: https://developer.mozilla.org/en-US/docs/Web/CSS/:has

But that compatibility table looks kinda depressing :P I don't think this is currently possible.