What I found fascinating with DS was he was happy with all colours and toys until he was about four. Then he started to come home from nursery and then school saying X colour was for girls and x toy was for girls because X child had said so.
As I understand it, this is a normal part of child development. It's when they understand that they are a boy or a girl, but they haven't yet understood that this is an unchangeable fact. They may still think that if they do things which are 'gendered' as for the opposite sex, they might actually change sex. There may also be a conforming aspect, that they think they 'should' do what is designated for their own sex.
Katie Alcock has written about this here:
https://archive.is/FQVF9
Now these days we are all anti-stereotyping and we are convinced we have not raised our children to know what sex stereotypes are. If the only influences on children were things people said directly to them, and especially things we as parents said directly to them, this might work out. But children don’t grow up in a vacuum — they see the other children at nursery, they see toys that other children play with, obviously they hear what other adults than their parents say but most of what children take in is not from people talking to them, but from what they see.
So when they see all the girls at nursery wearing pink and having long hair, well, that’s what girls do! And they also realise, from what people are saying, and from how their parents dress them, what toys they are given, and what toys other children who look like them (same clothes, same hair) what they are supposed to like and do based on what sex they are.