As fabrication methods continue to improve, diffractive optical elements that feature various sizes of illumination wavelengths are becoming available. Now, more accurate analysis and design methods must be used. In addition to a discussion of scalar design of gratings and zone plates, we survey several electromagnetic techniques for the design of mesoscopic, subwavelength, and evanescent optical elements. Wide arrays of numerical tools, suitable for periodic, aperiodic, inhomogeneous, and anisotropic elements, are discussed and design examples are presented.