Adaptation to different climates fuels the origins and maintenance of biodiversity. Detailing how organisms optimize fitness for their local climates is therefore an essential goal in biology. Although we increasingly understand how survival-related traits evolve as organisms adapt to climatic conditions, it is unclear whether organisms also optimize traits that coordinate mating between the sexes. Here, we show that dragonflies consistently adapt to warmer climates across space and time by evolving less male melanin ornamentation—a mating-related trait that also absorbs solar radiation and heats individuals above ambient temperatures. Continent-wide macroevolutionary analyses reveal that species inhabiting warmer climates evolve less male ornamentation. Community science observations across 10 species indicate that populations adapt to warmer parts of species’ ranges through microevolution of smaller male ornaments. Observations from 2005 to 2019 detail that contemporary selective pressures oppose male ornaments in warmer years; and our climate-warming projections predict further decreases by 2070. Conversely, our analyses show that female ornamentation responds idiosyncratically to temperature across space and time, indicating the sexes evolve in different ways to meet the demands of the local climate. Overall, these macro- and microevolutionary findings demonstrate that organisms predictably optimize their mating-related traits for the climate just as they do their survival-related traits.