Replies: 3 comments 2 replies
-
You mean you want to insert style to shadow root? Can you access shadow root? I think we may provide an API to allow user to specify style mount target. It's impossible to generate all style into a css file. We just not implement it. |
Beta Was this translation helpful? Give feedback.
-
Hi Akioni, yeah I understand for all style that can be not generated, and yes it could be cool if we can choose where the styles elements are appended to the dom. I have access to the shadow-root (open mode). My Vue app will be merge with a lot of other JS's App and Scripts in the same page. Making individual WebComponent using naive-ui may sound ok, but at least for the moment, I need a way to dev with this special env. I've tryed copying naive's styles element inside my shadow-root element every ctrl+s ( npm dev with Vite ) but at the end naive-ui are not 100% styled correctly ?! execept spin comp. the one broken are datePicker and Select (those I use for the moment) |
Beta Was this translation helpful? Give feedback.
-
Hi, Did you find a way to do it ? I use naive ui for front-end of a project that part of another parent project. I need encapsulate it. But I am new to use shadow DOM. |
Beta Was this translation helpful? Give feedback.
-
Hello all!
For the purposes of my project, the Vue application is loaded into a
ShadowDom
element (dev & prod env). The dev server Vite (I use Vite) for css styles add those in the<head>
tag , inside multiple<style>
tag... I made a very bad hack to tell Vite to add those in myShadowDom
element and allow me to develop the styles normally....But ! all styles related to naive-ui components are still added to the
<head>
tag ;( and therefore these styles cannot be applied to my app which contains naive components.My question, is it possible to generate a .css file which represents all the styles of the naive-ui components to then be able to import it into the
ShadowDom
element?Beta Was this translation helpful? Give feedback.
All reactions