Nighttime leg cramps may be related to foot position. We often sleep with our feet and toes extending away from the rest of our bodies, a position called plantar flexion. This shortens the calf muscles, making them more susceptible to cramping.