I have created a part that adds css and JS to my page.
I would like to have the part be visible from the editor mode, right now its invisible unless you happen to mouse over it.
I've found this documentation: https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-add-an-edit-mode-panel-snippet-in-sharepoint
The issue is that the documentation's context is limited to inserting snippets. I am building my web part through code. I have attempted to insert the snippet from that document into my part but it doesn't work. The element is always visible even when not editing.
How do I add an element to my web part that only appears in edit mode?