The new law took effect immediately and came after legislators overrode a veto from Democratic Gov. Josh Stein.