I've seen the (opaque) leggings with too-short shirt on a) a friend in her own home and b) several coworkers in the office.
Situation (a) is, to me, appropriate enough - I wouldn't do it myself, but I'm more self-conscious of my posterior particularly if I have guests over.
Situation (b) continues to surprise me. We aren't customer-facing (for the most part) but that is taking casual wear to an inappropriate level. The office in general is not actually that casual - some men and women still wear suits or blazers on a daily basis and most people wear slacks + button downs or nice sweaters. My inner fashion cop also frowns on men wearing loose cargo shorts to work. We are neither a gym nor a campground - these choices are not work-appropriate.
Banning leggings outright is not a good solution. As a PP suggested, the rule should be more along the lines of no visible undergarments, whether they are visible above, below, or through the covering fabric. This should be a rule for all ages in most public contexts.