How to get the path of current script
twio142 opened this issue · comments
twio142 commented
I often need to add a @media (prefers-color-scheme: dark)
part to the style sheet of a widget, which I didn't figure out how to implement in React.js natively. So as a workaround, I just append a <style>
node with the dark theme css. And of course I want this style sheet only to effect this specific widget, so I have to add the #folder-widget-filename-jsx
id to every block in the css.
So, is there a way to get the path of the script programmatically?