Timvde/UserChrome-Tweaks

Compact find bar overlaps sidebar when moved to right

Keith94 opened this issue · 7 comments

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

image

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.

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

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

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

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

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.

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.