(a) A governing body may not adopt a school dress code that
(1) prohibits a student from wearing a hairstyle that is associated with race;
(2) prohibits a student from wearing a natural hairstyle, regardless of the student’s hair texture or type; in this paragraph, “natural hairstyle” includes braids, locs, twists, tight coils, afros, cornrows, and bantu knots;
(3) requires a student to permanently or semipermanently alter the student’s natural hair; or
(4) prohibits a student from wearing traditional tribal regalia or objects of cultural significance at a graduation ceremony.
(b) Notwithstanding (a) of this section, a governing body may adopt a school dress code that restricts student hairstyles if the restriction is necessary to comply with a health or safety law, regulation, or ordinance.