A Texas school district that included masks as part of its dress code has been hit with a temporary restraining order.