Changing Children in front of Objects of Kedushah (Holiness)
According to halachah, a child’s soiled garment—or any inyan of tinuf (dirt)—should not be within the sight of a mezuzah; therefore, one should not change diapers in front of a mezuzah. There is a minhag (custom) not to have young children walk around undressed in front of Shabbos or Yom Tov candles out of respect for the mitzvah. In fact, it is considered a sakanah (dangerous) to walk around undressed in front of candles, even during the week. There are those who suggest that if one is changing a diaper or dressing a child in front of a candle, it’s not a problem as long as the child is uncovered for a very short time, since most likely it was inevitable before the advent of electricity. Nevertheless, one should not allow a child to run around in an untzniusdik (immodest) state. The Alter Rebbe writes that children should be appropriately covered in front of sefarim (holy books) as well. A solution for changing a diaper in a room where there are mezuzos, sefarim, or Shabbos or Yom Tov candles (or ordinary candles)—is for the person who is changing the diaper to stand in a way that effectively blocks the view from the mezuzos, sefarim, or candles. #354
https://asktherav.com/is-there-a-source-that-says-it-is-dangerous-to-be-naked-in-front-of-a-candle/