Strong selection can cause rapid evolutionary change, but temporal fluctuations in the form, direction and intensity of selection can limit net evolutionary change over longer time periods. Fluctuating selection could affect molecular diversity levels and the evolution of plasticity and ecological specialization. Nonetheless, this phenomenon remains understudied, in part because of analytical limitations and the general difficulty of detecting selection that does not occur in a consistent manner. Herein, I fill this analytical gap by presenting an approximate Bayesian computation (ABC) method to detect and quantify fluctuating selection on polygenic traits from population genomic time-series data. I propose a model for environment-dependent phenotypic selection. The evolutionary genetic consequences of selection are then modelled based on a genotype-phenotype map. Using simulations, I show that the proposed method generates accurate and precise estimates of selection when the generative model for the data is similar to the model assumed by the method. The performance of the method when applied to an evolve-and-resequence study of host adaptation in the cowpea seed beetle (Callosobruchusmaculatus) was more idiosyncratic and depended on specific analytical choices. Despite some limitations, these results suggest the proposed method provides a powerful approach to connect the causes of (variable) selection to traits and genome-wide patterns of evolution. Documentation and open-source computer software (fsabc) implementing this method are available from github (https://github.com/zgompert/fsabc.git).