First step at fixed label and handle support#441
First step at fixed label and handle support#441argyleink merged 2 commits intoGoogleChromeLabs:masterfrom
Conversation
|
hosted playground https://kilian-labels.glitch.me |
argyleink
left a comment
There was a problem hiding this comment.
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.
I'll try to do lots of QA on it. Did touch a lot of files, but we did teach a few components a new trick. You did notice a delta where some components have an updated api and others (label) dont. Agree on the suggestion to have label join the rest 👍
PR overall looks good! Does label.element.css need both position supplied?
Co-Authored-By: Adam Argyle <argyle@google.com>
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-labelwould benefit from the same API asvisbug-handle/visbug-hover, wherelabel.positionis giveneland boundingClientRect is calculated in the web component (andisFixedis determined there too).Now
labelneeds other plugins to deal with boundingClientRect, whilehandlejust calculates it itself.