Morocco is not like Saudi Arabia, where it is basically law that women must dress in a certain manner. However, women do dress in traditional Middle Eastern fashions. Below are some photos of female fashions in Morocco. (El Jadida, Fes, and Essaouira):
I am a young adult woman from North America and I travelled alone. I travelled to Marrakech, Rabat, Fes, El Jadida, High Atlas and Essaouira. However, I travelled during Ramadan. I did not receive any uncomfortable stares or advances during Ramadan. I was there a few days after Ramadan, and when I wore lower necklines (no cleavage), I got a lot of boob-stares.
As for touching, a persistent merchant stood beside me trying to convince me to buy a ceramic, and he poked my waist teasingly and gave me a little pinch. I looked at him like "what the fuck are you doing buddy?!!". After I saw nothing I liked at his shop, he took me to another shop where I didn't see anything I liked either. He started whispering to me and invited me back to his shop to "share some mint tea" and "exchange some stories", but I just told him "No, I'm okay. Thank you". Other than that, another young man walked passed me and said "You are so beautiful".
Sometimes I dressed in loose clothing. At other times, my jeans were fitted, and below my neckline would show, while I wore 3/4 sleeves "boleros" (see below). Again, during Ramadan I didn't get any inappropriate calls or stares, but after Ramadan they would stare a lot more.
Other female travelers of all ages receive pinching, groping, and sexual remarks. One man even reported that they offered to buy his teenage daughter off of him.
So how should you dress? Be advised, no matter how modestly you dress, you may still get sexual attention because of the preconceived notions of male-female relations in your country. Dress in loose fitting clothing with very little cleavage. You can wear blouses or loose t-shirts with short to long sleeves. I enjoyed wearing dresses and skirts because they kept me cool, while jeans and pants made me sweat. I would carry a couple thin "bolero" tops to cover my arms when I was wearing armless tops. This is a bolero jacket: