Inline vs Overlay vs Custom Root Container
I'm trying to put a border on specific divs around images on Amazon. They should only appear on hover (therefore I probably need to set pesuo-classes on that div). And I want to have a label ShopAdvisor with a + button next to it (therefore I think I need to add new divs regardless of if I decorate the existing HTML). The ShopAdvisor/+ div should be right-justified, which seems unimportant but it does mean the div needs context of its containing ancestor, right now it's only on the top left bc it's anchored.
I know I have access to the anchor and can do all that like so
but it doesn't seem clean, like I'm circumventing Plasmo when I shouldn't be. I'm new to Shadow DOM but it feels like that's what I should be using lol so modifying the anchor element seems wrong.
Custom Root Container does say this:
"Sometimes, you'll want to completely replace Plasmo's Shadow DOM container implementation to fit your needs. For example, you might want to piggyback on an element within the web page itself instead of creating a new DOM element."
And I do want to "piggyback on an element" but the name getRootContainer() and the example makes it feel like it's only suitable for one element at a time. I'm not sure what it does really.
Is there an obvious way to do this that I'm missing?
I know I have access to the anchor and can do all that like so
but it doesn't seem clean, like I'm circumventing Plasmo when I shouldn't be. I'm new to Shadow DOM but it feels like that's what I should be using lol so modifying the anchor element seems wrong.
Custom Root Container does say this:
"Sometimes, you'll want to completely replace Plasmo's Shadow DOM container implementation to fit your needs. For example, you might want to piggyback on an element within the web page itself instead of creating a new DOM element."
And I do want to "piggyback on an element" but the name getRootContainer() and the example makes it feel like it's only suitable for one element at a time. I'm not sure what it does really.
Is there an obvious way to do this that I'm missing?
