Question regarding slots as childs of divs #1912
Unanswered
hybridherbst
asked this question in
Q&A
Replies: 3 comments
-
Could you paste the HTML for the two cases or Glitch links so I can see what you mean? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Updated the question with the HTML! |
Beta Was this translation helpful? Give feedback.
0 replies
-
That's a good question; I definitely think the slot has to be the parent of everything else you want included. Not sure if there's a cleaner way to set up the CSS for this one. Any thoughts @cdata? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
For a particular usecase we're having, we require an AR Button area such as this:
(the button has a footnote specifying some details, and a link for privacy information).
I'm unclear however how to build that with model-viewer; I first tried wrapping the ar-button slot in a div and also putting that information in the div (which seemed like the right way, structurally), but then the slot is not detected (I get double buttons). From reading a bit about web component slots that might be by design?
I currently ended up putting all the elements into the slot button, but that requires really nasty CSS and also semantically doesn't feel right (a link in a button). Is there a better way to do this?
Does not work (slot not detected, regular AR button shows up):
Workaround (with hacky CSS, semantics are bad)
Beta Was this translation helpful? Give feedback.
All reactions