There is no magic involved in making stretch leggings. You need knit fabric. 4 way stretch fabric like lycra looks good. Ribbing makes a nice winter weight legging. If you make leg warmers to go with them or tuck them into boots they will look like tights.
Next you need a good fitting pattern. I used my1813 and 2013 Gathered Pull-ons patterns. They include a View 4 boxers pattern piece with no side seam that is perfect for leggings. All you need to do is make the pattern narrower before sticking the back and front together.
For the 18" dolls use pattern 1813 and cut off 1 1/4" strips from the View 4 boxers main pieces and the extensions. If you are sewing for an Australian Girl Doll you will need pattern 2013 and cut off
1 5/8" strips from the View 4 boxers main pattern piece and the extensions.
For 1/2" elastic trim off the seam allowance at the waist edge.
For 1/4" elastic trim off 5/8" from the waist edge.
Just a few photos to show you how easy it is.
Cut 2 back and front combined pieces. Make sure you mark the backs with a pin.
Stitch the centre front seam with a narrow zig zag or overlock it.
If you are using 1/2" elastic fold over 1" and stitch 1/8" from the edge with a narrow zig zag. There is no real need to overlock the edge first. Also stitch 1/8" from the fold edge.
If you are using 1/4" elastic fold over 5/8".
Make sure you have a look at my patterns either on Craftsy or Etsy
You need to make alterations to purchased patterns 1813 or 2013 to make the leggings.
Buy 1813 Gathered Pull-ons
Buy 2013 Gathered Pull-ons