In mountain areas, the distribution of plant communities is affected by both regional and microhabitat conditions. The degree to which these different spatial factors contribute to plant communities is not well understood, because few studies have used a uniform sampling methodology to measure trait variation across the range of ecological scales. In this study, a stratified sampling method was used to study community weighted leaf traits and environment factors at different spatial (transect and plot) scales. We measured 6 leaf traits (specific leaf area, leaf tissue density, leaf thickness, leaf carbon, nitrogen and phosphorus content) in 258 communities from 57 sites in 9 transects nested within 3 vegetation zones. These communities are located in the loess hilly and gully area of the Yanhe river watershed. We coupled climatic factors at the transect scale with topographic and edaphic factors at the plot scale using multilevel regression modeling to analyze the trait variation associated with spatial scales. At the transect scale, the mean annual rainfall showed a highly significant positive effect on the leaf nitrogen concentration (LNC) (p < 0.01), while it had a highly significant negative effect on leaf thickness (LT) and leaf tissue density (LTD) (p < 0.001) and a significant negative effect on leaf carbon concentration (LCC) (p < 0.05), explaining 10.91%, 36.08%, 57.25% and 66.01% of LTD, LT, LCC and LNC variation at transect scale respectively. At a plot scale, the slope aspect showed a highly significant positive effect on specific leaf area (SLA) and LNC but a highly significant negative effect on LT and LTD. The soil water content had a significant negative effect on LT (p < 0.05) and LTD (p < 0.001) while soil organic matter showed a positive effect on SLA (p < 0.001) and LNC (p < 0.01). Totally, plot scale variables explained 7.28%, 43.60%, 46.43%, 75.39% and 81.17% of LCC, LT, LNC, LTD and SLA variation. The elevation showed positive effect only on LCC (p < 0.05). The results confirmed the existence of consistent trait–environment relationships at both transect and plot scales. These trait–environment relationships at different spatial scales will provide mechanistic understanding on the vegetation community assembly in the study area. Practically, ignoring trait variation within transects will underestimate roles of microhabitat filters in community assembly, and leads to the homogenization of restoration species. This will be like the past restoration plans and programs, causing serious environmental problems such as dwarf trees and soil desiccation.