We study a setting where anti-discrimination legislation gives rise to adverse selection in the labor market. Firms rely on nonlinear compensation contracts to screen workers who differ in their family/career orientation. This results in a labor market equilibrium where career-oriented workers are offered an inefficiently low duration of parental leave. In addition, family-oriented workers are offered lower wages as compared to their equally skilled career-oriented counterparts. We demonstrate the usefulness of mandatory parental leave rules in mitigating the distortion in the labor market and derive conditions under which a Pareto improvement is possible. We also characterize the optimal parental leave policy and highlight the possibility for parental leave legislation to eliminate the wage penalty of family-oriented workers by supporting pooling employment contracts.