Plasticity, both within and across generations, can shape sexual traits involved in mate choice and reproductive success, and thus direct measures of fitness. Especially, transgenerational plasticity (TGP), where parental environment influences offspring plasticity in future environments, could compensate for otherwise negative effects of environmental change on offspring sexual traits. We conducted a mate choice experiment using stickleback ( Gasterosteus aculeatus) with different thermal histories (ambient 17°C or elevated 21°C) within and across generations under simulated ocean warming using outdoor mesocosms. Parentage analysis of egg clutches revealed that maternal developmental temperature and reproductive (mesocosm) environment affected egg size, with females that developed at 17°C laying smaller eggs in 21°C mesocosms, likely owing to metabolic costs at elevated temperature. Paternal developmental temperature interacted with the reproductive environment to influence mating success, particularly under simulated ocean warming, with males that developed at 21°C showing lower overall mating success compared with 17°C males, but higher mating success in 21°C mesocosms. Furthermore, mating success of males was influenced by the interaction between F1 developmental temperature and F0 parent acclimation temperature, demonstrating the potential role of both TGP and within-generation plasticity in shaping traits involved in sexual selection and mate choice, potentially facilitating rapid responses to environmental change. This article is part of the theme issue 'The role of plasticity in phenotypic adaptation to rapid environmental change'.