Using Tippy in shadow DOM
See original GitHub issuehttps://codepen.io/anon/pen/ErExqd
Since scripts can access my shadow DOM but styles can’t, I tried to inline the Tippy CSS within the shadow DOM and link Popper’s and Tippy’s JS outside. I need the CSS to be scoped so I have the following constraint:
<style>
:host {
all: initial; /* 1st rule so subsequent properties are reset. */
display: block;
contain: content; /* Boom. CSS containment FTW. */
/* any other CSS, so this is where I inlined the Tippy's */
}
</style>
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How do I use Tippy in shadow DOM with scoped CSS?
Show activity on this post. I want to use Tippy. js in my shadow DOM. Since scripts can access my shadow DOM but...
Read more >All Props | Tippy.js - GitHub Pages
Prop Default Description
plugins Specify plugins to use. See Plugins for details.
role "tooltip" Specifies the role attribute on the tippy element.
zIndex 9999 Determines the...
Read more >query-selector-shadow-dom - npm
Start using query-selector-shadow-dom in your project by running `npm i query-selector-shadow-dom`. There are 23 other projects in the npm ...
Read more >Reporters | Vanilla JS (Custom element) - Felte
Felte offers an easy plugin-like way of reporting your errors by using what we ... to be either on the light DOM, or...
Read more >Tooltip-Arrow with drop shadow - CodePen
All packages are different, so refer to their docs for how they work. If you're using React / ReactDOM, make sure to turn...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@atomiks Just had an issue implementing a custom element for Tippy in a Polymer 3 project (using ShadowDOM). Turns out the error lies here. Hacking it by setting isVirtual to true on the target element works, but I’m not sure if this has any other side effects. Please consider allowing us to either disable the auto-destroy or specify a different root element to search in.
This statement is because different browsers handle disabled elements differently. In Firefox I think it works, but not Chrome. So standardizing disabling it makes sense. It’s recommended to use a wrapper node instead.
I kind of want to overhaul the setup to allow for DEV-only warnings, and a development build. Like React. That way the production/minified version doesn’t have any warnings. There are tons of places I’d like to add some warnings but didn’t because I didn’t want to bloat the bundle size