Closed Kilian closed 4 years ago
hosted playground https://kilian-labels.glitch.me
Does
label.element.css
need both position supplied?
I followed the way the other custom properties were defined in that file but I'm happy with using a fallback there too like I did in another file.
hm, what should we do with position sticky elements?
I don't know. Unless we make the labels children of the elements I can't think of a way that doesn't involve adding listeners to everything that's position sticky and getting their position on each scroll.
i dont have any good answers either. this PR is pending squash and merge until I can do a local build and verify across a few test sites. tests and staging look good tho!
This ended up needing changes in quite a bunch more files than anticipated, and might need other things to update as well but I don't quite have the overview for that.
My feeling is that
visbug-label
would benefit from the same API asvisbug-handle
/visbug-hover
, wherelabel.position
is givenel
and boundingClientRect is calculated in the web component (andisFixed
is determined there too).Now
label
needs other plugins to deal with boundingClientRect, whilehandle
just calculates it itself.