What’s the dress code around major attractions in Switzerland? Will slight revealing dresses be ok around major tourist attractions?
It depends on which kind of tourist attraction and when. I still remember seeing on Swiss TV an interview to the keeper of a refuge at Jungfraujoch; we were in the middle of the August 2003 record heatwave. There were 7 °C at Jungfrau at midday (that is 44 °F) and he was in a T-shirt, profusely sweating as he did not remember so hot a summer.
Depends on your definition of "slightly revealing" and how revealing "slightly" actually is. :-)
If you are visiting churches, revealing might get you kicked out. If you are visiting castles probably not. Just remember that Switzerland is a cooler temperature most of the year than you might expect.
Your attire will be fine anywhere really, except for perhaps churches. As far as temperature, it really depends on where you are in Switzerland and the time of year. We're along the shores of Lake Geneva near Chateau Chillon and it gets hot. In general, the higher you go, the cooler it gets so bring layers if you are traveling between elevations.