  The Rosseland mean opacity of dust in protoplanetary disks is often
calculated assuming the interstellar medium (ISM) size distribution and a
constant dust-to-gas ratio. However, the dust size distribution and the
dust-to-gas ratio in protoplanetary disks are distinct from those of the ISM.
Here, we use simple dust evolution models that incorporate grain growth and
transport to calculate the time evolution of mean opacity of dust grains as a
function of distance from the star. Dust dynamics and size distribution are
sensitive to the assumed value of the turbulence strength $\alpha_{\rm t}$ and
the velocity at which grains fragment $v_{\rm frag}$. For moderate-to-low
turbulence strengths of $\alpha_{\rm t} \lesssim 10^{-3}$ and substantial
differences in $v_{\rm frag}$ for icy and ice-free grains, we find a spatially
non-uniform dust-to-gas ratio and grain size distribution that deviate
significantly from the ISM values, in agreement with previous studies. The
effect of a non-uniform dust-to-gas ratio on the Rosseland mean opacity
dominates over that of the size distribution. This spatially varying -- that is
non-monotonic -- dust-to-gas ratio creates a region in the protoplanetary disk
that is optimal for producing hydrogen-rich planets, potentially explaining the
apparent peak in gas giant planet occurrence rate at intermediate distances.
The enhanced dust-to-gas ratio within the ice line also suppresses gas
accretion rates onto sub-Neptune cores, thus stifling their tendency to undergo
runaway gas accretion within disk lifetimes. Finally, our work corroborates the
idea that low mass cores with large primordial gaseous envelopes
(`super-puffs') originate beyond the ice line.
