I usually say Kriat Shma Al Hamita before I go to sleep when I’m wearing sleeveless pjamas. I also wear shorts but cover my legs with the blanket. However when I stand to say Vidui my legs get uncovered. I never thought it was a problem since Hashem has seen me in every which way - tznius and not. Now it’s Elul and I wonder if I should be more strict or if its ok.
Shalom, Thank you for your question. The laws of appropriate dress for prayer are very important, and certainly wearing pyjamas would not be correct when praying Shachrit, Mincha or Maariv – as the halacha requires one to wear clothing that one would dress in for an important event (or at very least as one would dress to go out in the street). However, that requirement is for the saying the Amidah – not for every blessing or prayer we say. For example, the Mishna states that a woman may say a blessing even naked, if she is sitting down in such a way as to cover her genitals. So too, one could say a blessing over food at the (separate, women's) beach when wearing only a swimming suit. This is true for saying Shema at bedtime also. You may say it when wearing your pyjamas, even though they are not fitting to pray the Amidah in (unless one has no other choice – for example a sick or unwell person should rather pray even the Amidah in their pyjamas rather than not pray at all). The vidui may also be said in your pyjamas. Of course there are levels of holiness, and one who felt they were able to dress in an even more modest way when saying these prayers would have room to take upon themselves additional stringencies of dress for all prayers (and not just the Amidah). But that would be a stringency and not the requires law. As such, one should weigh up whether this stringency is appropriate for them at their particular place and growth towards serving Hashem. Blessings.