Up to 1940, there were preferences but also a lot of variability in colors, as well as assignment to gender. Around 1918, the preference in the US was blue for girls, pink for boys. By 1940, it seems to have been reversed. At that time, the related industries apparently detected a commercial opportunity and must have started a concerted effort to promote the current gender assignment.