A phase-field model for the Hele-Shaw flow of non-Newtonian fluids is developed. It extends a previous model for Newtonian fluids to a wide range of shear-dependent fluids. The model is applied to perform simulations of viscous fingering in shear- thinning fluids, and it is found to be capable of describing the complete crossover from the Newtonian regime at low shear rate to the strongly shear-thinning regime at high shear rate. The width selection of a single steady-state finger is studied in detail for a 2-plateaux shear-thinning law (Carreau law) in both its weakly and strongly shear-thinning limits, and the results are related to previous analyses. In the strongly shear-thinning regime a rescaling is found for power-law (Ostwald-de-Waehle) fluids that allows for a direct comparison between simulations and experiments without any adjustable parameters, and good agreement is obtained.