Back in the day, infants of all genders wore white frocks—white, because it could be bleached of any infant spewage, and frocks, because it's easier to wriggle a baby into a dress than into britches. Franklin Delano Roosevelt's 1884 toddler photo depicts our dignified to-be president sitting primly in a white skirt and patent leather shoes.
Eventually, parents began dressing their infants in "the colors of springtime," but it wasn't until World War I that those colors became gender signifiers. In June 1918, the Earshaw Infants' Department instructed parents, "The generally accepted rule is pink for the boys, and blue for the girls. The reason is that pink, being a more decided and stronger color, is more suitable for the boy, while blue, which is more delicate and dainty, is prettier for the girl."