I wouldn't wear leggings to work as it would be inappropriate everywhere I've worked. Tbh, I struggle to think of a workplace where leggings and a top that just covers your backside is appropriate.

For casual wear, it would depend on where you were going.