That's exactly what I want to avoid. My goal with it would be to be more persistent. You would just need to add a css comment on the line that would look different on the dark theme, so in 1 css file you could define the support for the dark-mode plugin.
For example you have in the main css:
body
{
background-color: #ffffff; /* D@RK: #000000 */
}
If in a new Jenkins version you decided to rename the css tag to like '#body', but you still have that comment, the program can still substitute it when dark mode is on.This way you only have 1 css file but it has a dark mode and a normal mode. It wouldn't be at runtime though. Only at startup, plugin upgrading, installing or removing. It would cache the substituted css in a folder, and render it if a view needs it.
TBH I don't think scanning and substituting existing files will scale well, and it may not be ressilient to changes. I agree with oleg_nenashev that a better alternative would be to use a custom theme using the simple-theme-plugin. You can take inspiration on the material or neo2 themes.
In the medium/long term I would like to have the UI themable using CSS variables, but we lack infrastructure at the moment for that.