I can recommend f.lux. With it the whole environment becomes of about the same light. Without it, and with a dark theme in your code editor you have one level of light, and when you switch to a web browser you can bombarded by photons. :-/
The opposite is true. The screen should match the ambient lighting of the room. Eye strain is caused by constant iris resizing. Looking at the screen, and the wall next to the screen shouldn't require you eye to adjust.
I actually had to switch to Solarized Light for awhile because my eyes couldn't stand white text on a dark background. I'm back to using a dark theme now though.