Can get the current site collection url inside the "SharePoint/assets/elements.xml", inside SPFx

Valued Contributor

I am working on an SPFx web part, which inject a custom css inside the site collection. Now i define the location of the custom css file inside the ClientSideComponentProperties inside the SharePoint/assets/elements.xml file as follow:-

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="">



so in the above case the custom.css file will be located inside a site collection with this static url but can i change the location of the file to be dynamically inside the current site collection (where the web part will be added) ? so on each site collection i will define a library named customcss and add the custom.css file inside it? is this possible?


0 Replies