Distyly, a floral dimorphism that promotes outcrossing, is controlled by a hemizygous genomic region known as the S-locus. Disruptions of genes within the S-locus are responsible for the loss of distyly and the emergence of homostyly, a floral monomorphism that favors selfing. Using whole genome resequencing data of distylous and homostylous individuals from populations of Primula vulgaris and leveraging high-quality reference genomes of Primula we tested, for the first time, predictions about the evolutionary consequences of transitions to selfing on S-locus genes. Our results confirm the presence of previously reported homostyle-specific, loss-of-function mutations in the exons of the S-locus gene CYPᵀ, while also revealing a previously undetected structural rearrangement in CYPᵀ associated with the shift to homostyly. Additionally, we discovered that the promoter region of CYPᵀ in distylous and homostylous individuals is identical, suggesting that down-regulation of CYPᵀ via mutations in its promoter region is not a cause of shift to homostyly. Furthermore, we found that hemizygosity leads to reduced genetic diversity and less efficient purifying selection in S-locus genes compared to genes outside the S-locus, and that the shift to homostyly further lowers genetic diversity, as expected for mating-system shifts. Finally, we tested, for the first time, long-standing theoretical models of changes in S-locus genotypes during early stages of the transition to homostyly, supporting the assumption that two (diploid) copies of the S-locus might reduce homostyle viability.