We offer a theory of changing dimensions of political polarization based on endogenous social identity. We formalize voter identity and stereotyped beliefs as in Bonomi et al. (2021), but add parties that compete on policy and also spread or conceal group stereotypes to persuade voters. Parties are historically connected to different social groups, whose members are more receptive to the ingroup party messages. An endogenous switch from class to cultural identity accounts for three major observed changes: i) growing conflict over cultural issues between voters and between parties, ii) dampening of political conflict over redistribution, despite rising inequality, and iii) a realignment of lower class voters from the left to the right. The incentive of parties to spread stereotypes is a key driver of identity-based polarization. Using survey data and congressional speeches we show that - consistent with our model - there is evidence of i) and ii) also in the voting realignment induced by the ”China Shock” (Autor et al. 2020).