I’m new to develop a UXP for Indesign.
I’m actually on playing around with the functionality so I want to use the spectrum web components in the plugin. At this point I want to put aside using webpack or else so I added the elements.js directly in the index.html head width
<script src="node_modules/@spectrum-web-components/bundle/elements.js" type="module" async></script>
Buit it looks like that the css part is missing. If I use the icon component I got a warning sign or on some buttons there are missing the color.
Does the elements.js not also load the necessary css for the composnnets?
on UXP, spectrum-web-components don’t work at all only itself.
as the document mentioned that, it needs wrappers.
because UXP doesn’t support some CSS properties so I think wrappers solve those problems on webpack.
I don’t know how to work it without webpack. but it obviously not works only components.
Thanks for your reply. I haven’t read something about the wrapper so thanks for the information. I will try to use this. If it will not work without webpage so I will include this. But I thought at the start it is a little bit overwhelming to set up the whole build thing only for playing around .
I think it’s worth clarifying that this wrapper doesn’t add CSS to UXP, it just replaces non-UXP compliant with CSS that that is, and only in the context of that specific SWC component.
Hi @KDJFS, thats true. By importing the elements.js you may not be able to get everything needed for the component to work correctly.
Is there a particular reason why you dont want to use webpack at all? If its about the complication to setup such project, please take a look at our starter plugin https://github.com/AdobeDocs/uxp-indesign-samples/tree/main/plugins/swc-uxp-starter we recently added.