Not sure exactly, but I am fairly confident that the queen does try to avoid sunlight. When the queen is on the face of a frame, it will more than not, run to the other side of the frame, or the “dark side” that is not exposed to the sun.
Also, when you are trying to find a queen in a hive, and you have already removed frames, I have found that she is far more often on the side of the frame that is not exposed to the sun (the “dark side”) than the side that has been exposed to light.
It is purely anecdotal based on my limited experience, but I think queens seek the dark areas of the hive when there is exposure to the sun.