I use excalidraw to manage my diagrams for my blog
TL;DR I use an Excalidraw, wrap the elements of interest with a frame, name it with export_ prefix, my forked excalidraw extension automatically generates SVGs for light and dark mode....
https://blog.lysk.tech/excalidraw-frame-export/