Genetically-based trait variation across environmental gradients can reflect adaptation to local environments. However, natural populations that appear well-adapted often exhibit directional, not stabilizing, selection on ecologically-relevant traits. Temporal variation in the direction of selection could lead to stabilizing selection across multiple episodes of selection, which might be overlooked in short-term studies that evaluate relationships of traits and fitness under only one set of conditions. Furthermore, non-random mortality prior to trait expression can bias inferences about trait evolution if viability selection opposes fecundity selection. Here, we leveraged fitness and trait data to test whether phenotypic clines are genetically based and adaptive, whether temporal variation in climate imposes stabilizing selection, and whether viability selection acts on adult phenotypes. We monitored transplants of the subalpine perennial forb, Boechera stricta (Brassicaceae), in common gardens at two elevations over 2-3 years that differed in drought intensity, quantifying viability and fecundity fitness components for four heritable traits: specific leaf area, integrated water-use efficiency, height at first flower, and flowering phenology. Our results indicate that genetic clines are maintained by selection, but their expression is context dependent, as they do not emerge in all environments. Moreover, selection varied spatially and temporally. Stabilizing selection was most pronounced when we integrated data across years. Finally, viability selection prior to trait expression targeted adult phenotypes (age and size at flowering). Indeed, viability selection for delayed flowering opposed fecundity selection for accelerated flowering, demonstrating that neglecting to account for viability selection could lead to inaccurate conclusions that populations are maladapted. Our results suggest that reconciling clinal trait variation with selection requires data collected across multiple spatial scales, time frames, and life history stages