I just installed a replacement fixture and ran into a small puzzle.
This fixture, and its predecessor, are mounted on back-plates. The plate has curved slots in the middle for screws into a box, and then holes off towards the ends intended for anchors.
The original builders of the house didn't center the box on the vanity. They mounted the back-plate off-center, and used a pair of mammoth toggle bolts for the anchors. The box was still 'in range' for the wires to come through the center of the plate. Even so, position was not, in fact, centered over the mirror. (It was aligned with the right hand edge.)
I didn't really tune into the position, and just put up the new one screwed to the box (with the more modest anchors supplied with the fixture), and I'm living with it being not-quite-centered over the mirror.
My question: Are there are any code issues with a lack of a mechanical connection to the box.
I am planning to replace another (larger) one of these, and I would not be surprised if the box is nowhere near the supplied holes, and I have to drill the back-plate. My expectation is that so long as there is ground connecting the box, the plate, and the fixture ground, all is well, but I write to check.