That's my concern as well.. FWIW, you can dynamically set the content in most UI frameworks for the raw SVG content, which can use CSS properties for attribute usage beyond a single color... so you could use var(--brand-color) and match against body.dark or body.light for adjusting an accent color as well.
Assuming your light/dark integration changes the html or body element as appropriate, most will/do just that. I will generally detect for localStorage falling back to native preference, then set the html element appropriately as well as integration with my UI toolkit as such. I do similar for handling various side-menu states combined with breakpoint integrations.