Theoretical analysis of the near-field magneto-optical (MO) diffraction of light propagating through a ferromagnetic film by a domain structure has been carried out. The results are expressed in terms of the classical theory of diffraction gratings, namely the effective perturbation of the index of refraction and generalised Bragg condition, extended to the near-field case. The near-field case is characterised by a wider variety of types of diffraction, which includes diffraction by in-plane polarisation, both anisotropic and isotropic. It has been shown, analytically and numerically, that the effective layer of a ferromagnetic film that actively contributes to the MO diffraction is severely limited by the Bragg condition, being of the order of d/4, where d is the period of the diffraction grating. Any further increase in the thickness leads only to additional optical losses due to the light absorption. This can explain the lack of resolution reported in the near-field MO experiments where relatively thick garnet films were used.