weight gain

i’ve gained 40lbs during my pregnancy so far, i have 2 weeks until my due date but anyways all of my yoga pants & sweatpants are really tight now i was wondering if i would lose the weight in my legs and thighs when i give birth? or would it stay with me? or does it depend?