Michael ~ It depends...
"Safari and WebKit do not auto-darken web content — documents will need to opt-in to dark mode." [Source] In other words, webpage designers have to... "see if your device is in dark mode or light mode and adjust the site theme to match." Source:
Say hello to Dark Mode on iMore!
This is actually the precise reason why apple should not be forcing users who are reliant upon accessibility modes like smart invert to use dark theme. Apple appear to be too interested in satisfying demands of development community more interested in gimmicky looks rather than actual function. At present I have had to set p a number of different automations which either enable or disable smart invert or classic invert as some programs work ok in dark theme and others still work in smart invert, however some now require classic invert to be accessible as often smart invert actually inverts the dark theme so you are ostensibly working in a light theme.. As has been mentioned by others earlier it would be interesting to find out how mu;h texting was done prior to launch of dark theme and whether any accessibility testers where involved. I know that the Accessibility support tech I spoke to apple wasn’t aware of the conflicts between dark theme and smart invert.
Dark theme NEEDS to be seperate to Smart Invert, Dark theme is a visual convenience, Smart Invert is an accessibility function