Creating a tapered pattern in shader nodes
Depending on the direction of your UV mapping, you might have to switch X and Y in this kind of set-up, which follows your modulo + color-ramp method as far as possible:

Any other method which makes the Less-Than threshold depend on a  dimension orthogonal to the one whose modulo is taken will do the same.

This tree also makes the period, base, and amplitude of the triangle-wave adjustable.