Add undo styling for inactive or active classes