It may come as a surprise, but it wasn’t until the advent of World War I that blue and pink were promoted as gender-binary colors. This change was largely correlated with the increasing capacity for prenatal testing, since parents were more easily swayed by marketers to buy more individualized clothing and accessories for their expected child. The article reminds us that even though our associations with color often seem deep-rooted in our consciousness and are highly predictable, they are still very much dependent on cultural factors.
https://www.smithsonianmag.com/arts-culture/when-did-girls-start-wearing-pink-1370097/