It's always worth checking the lit built in directives list for the one you've still missed (or at least it is for me ;).
I think in this case the ref() directive - i.e. https://lit.dev/docs/templates/directives/#ref - may be what you want. If it isn't exactly, reading how it's implemented would be my first step towards building something similar that is.
Thanks I created a custom directive, it's just ten lines of code and it works beautifully. Simply grabbed the `part.parentNode` property. I did the same for a `transition` directive that does something similar to using `appear` in Vue transition to have a nice fade in on first load.
I think in this case the ref() directive - i.e. https://lit.dev/docs/templates/directives/#ref - may be what you want. If it isn't exactly, reading how it's implemented would be my first step towards building something similar that is.