Don’t faint if you see, as I have several times, young Thai women in skirts or even short miniskirts praying like everyone else in a temple.
It really puts things into perspective.
Practically speaking, my wife usually dresses as she normally does—shorts and a t-shirt—and wears a very light sarong over the top, like the ones you can buy in Thailand. Hers has a gecko printed on it. It covers well, and she doesn’t get as hot as she would in a shirt and pants.
We’ve never had any comments or disapproving looks. That said, it’s a country where people appreciate a smile and respectful behavior in places of worship. Most don’t really care about the rest.
The most important temples are ranked as 4th, 3rd, 2nd, and 1st royal class, with the Grand Palace completely in a league of its own at the top of the hierarchy. Here and there, the rules are enforced a bit more strictly—but even then, not by much.
At the Grand Palace, they don’t mess around with protocol.