最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

css - Svelte without Shadow-Dom not possible? - Stack Overflow

programmeradmin1浏览0评论

How to build a Svele-Component without shadow-DOM?

There are a lot of discussions on GitHub

  • 1748 (2018)
  • 4073 (PR / 2019)
  • 2516 (2019 / with Comment from Rich Harris, but he also had no clear answer)

Until Svelte-4 i could solve this with chriswards npm-package svelte-tag. But, Since Svelte-5 changed a lot this way is not working anymore.

On this post Hjorthhansen concluded «Ultimately, shadow DOM is not a requirement in order to build Web Components.»

Is it really true that there is no way to build Svelte as a custom element without Shadow DOM?

In my case, I work on Rails, with Vite as the front-end engine. Overall, I want to work the Rails way, but have the ability to build some special elements with Svelte. But if styles cannot be applied there, it makes no sense.

发布评论

评论列表(0)

  1. 暂无评论