Librewolf turns on resist fingerprinting by default. If you go into about:config and disable resist fingerprinting, you can re enable light/dark mode preferences being recognized by the browser.
Or you could install the Dark Reader extension, but that will overwrite all CSS and approximate Dark Mode rather than use a customized CSS stylesheet.
Or you could install Vanilla Firefox and use that only to develop while you use Librewolf to privately browse, which is what I do.