As a female, I spent a long time worrying about what I would wear when visiting Marrakech. I was there end June/beginning July and it was extremely hot.
Reading some comments on here, I really thought I would have to completely cover up.
I saw a wide range of 'fashion' whilst there but didn't see anyone being hassled, although there is no doubt the young men do like a good long look at the ladies.
For me, tunic tops with capped sleeves worn with linen trousers worked best. I chose not to wear spaghetti strapped tops or anything other than 3/4 length and full length linen trousers. Maxi dresses would also be a great addition to your luggage.
I knew I wanted to be respectful and I felt fine.
As it turned out, I didn't really dress any differently than I do here in the UK.
My advice .... try not to worry, be comfortable, and if in any doubt, take/buy a pashmina or two.
On another note don't be afraid of Jemaa El-Fna....yes you hear people calling to you, trying to sell you this or that, trying to persuade you to eat at their food stalls but if you are not interested a polite 'no thanks' will do the trick. Its an amazing experience to be there so relax and enjoy it. Don't forget a visit to the Souks.
Finally don't do what I did and take a horse and carriage ride if you have an allergy to horses. The double dose anti histamine didn't do the trick as I thought it would!
Go, have fun & enjoy this amazing city.