It all started with shows such as “Blaze & the Monster Machines” and “Doc McStuffins.” Over the past decade, many preschool children’s animated shows have shifted toward showing a more diverse cast and including storytelling that features STEM themes — problem-solving that’s focused on subjects including basic understanding of math, engineering and the sciences.

“I do think that there are far more STEM animated shows, especially for preschoolers,” says Amy Friedman, head of kids and family programming for Warner Bros. “If you’re doing preschool programming, you’ve got to have an educational foundation because you’re always teaching. The question is what are you teaching? Everything teaches something. You just may do it intentionally or unintentionally.”

In May, Cartoon Network began airing “Sesame Street Mecha Builders,” which focuses on a reimagined cast of Elmo, Cookie Monster and Abby Cadabby, who play robot heroes-in- training.

Together, they use their STEM superpowers to solve problems.

This summer, Cartoonito on Cartoon Network and HBO Max will premiere “Bugs Bunny Builders,” an animated show based on the Looney Tunes characters that has a STEM/construction focus.

Jeff Borkin and Ellen Martin, the creators of “Blaze & the Monster Machines,” which was originally released in 2014 on Nick Jr., wanted to make a show for their own kids that broke down scientific concepts in fun ways that preschoolers would be able to understand. It was a tall order but after meticulously testing story ideas with parents and the intended preschooler audience, they found storytelling approaches that worked.

“STEM shows for kids are hard to develop but we wanted to do it because not a lot of people were doing it at the time and there are a lot of roadblocks in communicating STEM to little kids and keeping them interested,” Martin says.

Adds Borkin: “Our development process might be different than a lot of other shows because before we write a script, we make a picture book version of the show and show it to kids and we watch how they react. We did that for every episode, not just in the development process, and I think that’s part of what set us apart.”

In 2012, “Doc McStuffins” also premiered on Disney Junior and featured the first Black female lead who aspired to a STEM career like that of her mother’s.

The show is celebrating the 10th anniversary of its premiere with a musical special that will air on the network later this year. Disney Junior will add “Eureka!,” which features a girl of color in the lead who solves problems using scientific thinking, and “Alice’s Wonderland Bakery,” an animated program about a descendant of the original “Alice in Wonderland” who creates recipes using math and science.

“Alice’s Wonderland Bakery” has “such a creative element” to it, creator Chelsea Beyl says. “And then all the STEM elements of baking kind of just fell into place. Baking involves measuring and counting. She’s still using real world tools and tricks to bake.”

As with many STEM-based shows, the writers of “Eureka!” refer to science education consultants to make sure the science they’re using is correct and that the way they’re presenting it will make sense to their intended audience.

“There is a little bit of creative license because dinosaurs and woolly mammoths were not hanging out together,” says the show’s science consultant, Christiana “Chee” McGuigan. “I’ve been involved in many steps along the way. Sometimes, I would talk with writers when they had a concept or idea for something and they wanted an opinion on how scenically possible it would be or they ask for what kind of shape a scientific invention should be.”