-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: support for shadow dom in Twind v1? #421
Comments
You can view a preview of the docs here: https://next.twind-style.pages.dev/with-web-components. I have added a Lit as well in case you are using that: https://next.twind-style.pages.dev/with-lit There was a small issue that will be fixed in the next release (#417). Until that is released you can use the pre-release version (for example If you have any issues or questions please re-open this issue. |
@sastan, thanks; it seems to be working for me. I also wrote small guide in case others are looking for the solution https://gourav.io/blog/tailwind-in-shadow-dom |
I have implemented in a new integration: This will be released soon (#417). Until is released you can use the pre-release version (for example |
Nice article. One thing I wonder: the new import install from "@twind/with-shadow-root";
import config from "./twind.config";
const attach = install(config);
attach(document.querySelector(".my-shadow-root-container")) I really don't know if there is a use case for this. Are you using such a pattern? |
@sastan I'll give you some context... I'm developing a chrome extension and need to show some UI using shadow DOM on web pages so that the styles don't get leaked to the page. You're right that |
Describe the problem
How to add Tailwind classes inside shadow dom?
Describe the proposed solution
There was a nice documentation about adding support for shadow DOM for the beta version https://twind.dev/usage-guides/web-components.html, but the required classes
create
andcssomSheet
are not present in the latest version. This is also not mentioned in the migration guide.Alternatives considered
No response
Importance
I cannot use Twind without it
Additional Information
No response
The text was updated successfully, but these errors were encountered: