Not too big. Not too small. The fairy-tale romp Shrek The Musical, gets it just right as it settles in for a long holiday stay at the Walnut Street Theatre.

This is a play for kids and for anyone whose inner child can connect with fart-sharing ogres, a smart-ass donkey, and a dangerously love-struck dragon.

Tap-dancing rats and buffoonish soldiers add to the exuberance. And there’s an occasional insider reference to classic musicals (Gypsy, Dreamgirls, Hair and anything Bob Fosse) for grown-ups who are paying attention.

It’s funny, flashy, and wildly exuberant. It’s also reasonably scaled — the right size for the material, the house, and the viewers. The stage magic in the Walnut production is achieved with fewer performers and half the musicians (12) of the Broadway version, and with no talking Mirror-Mirror on the Wall. And in this case less is more.

I saw the local production twice: first at a matinee viewing with my 9-year-old shadow, Leah (who loved it), and then at Wednesday’s official opening night, with the same core cast but a different (weeknight) set of children fleshing out support roles in equally fine form.

The talented kids act the younger selves of principal characters, plus various small-stature roles like the Seven Dwarfs and one pack of the dancing rats.

The saga’s resident bad guy, Lord Farquaad, is played by actor Ben Dibble in a tour de force that gives kids a villain they can laugh at — exactly the point.

So how does less become more?

Director Glenn Casale and choreographer Robbie Roby have whipped this silly concoction to a froth, so light it’s almost gravity-defying.

The production highlights David Lindsay-Abaire’s snappy, joke-strewn libretto and Jeanine Tesori’s amiable pop-Broadway score without overselling the stuff. (By the second listen, I was humming along on the power ballads.)

Grabbing the biggest laughs is Dana Orange’s deliciously blunt Donkey, especially in the soulfully seductive production number “Make a Move.”

Costuming (Mary Folino), lighting effects (Charlie Morrison) and scenic elements — including Richard Bay’s large-scale puppetry flown in from Broadway Sacramento — are on the mark, too.

The plot you likely know: Our not-so-scary giant of an antihero — the green-skinned, trumpet-eared ogre Shrek (thoughtfully “unpeeled” by Nichalas L. Parker) has been roused from the tranquility of his swamp by an invasion of fellow “freaks,” including that nosey fibber Pinocchio (Adam Hoyak), immature Peter Pan (Elliot Styles), and a Big Bad Wolf (Dallas Padoven) who’s ready to jump out of the closet.

"Shrek The Musical" at Walnut Street Theatre
Mark Garvin
"Shrek The Musical" at Walnut Street Theatre

Mixed in with the fun, there’s more than a touch of heartfelt sympathy for all the outcasts. All have been expelled from their homeland by an equally geeky (though he seems not to notice) monarch, Dibble’s egomaniacal Lord Farquaad.

Shrek sets off to town to protest the migrant invasion, meets up with that chatterbox Donkey, and makes a deal with Farquaad to go fetch him a princess-in-distress to wed.

That would be Fiona (the sure-throated and firmly funny Julia Udine), who has been locked in a tower with only Rapunzel and Sleeping Beauty storybooks to read and with the fire-breathing Dragon (voiced by Donnie Hammond) warding off all would-be Prince Charmings. Until now.

Eventually, the whole army of storybook characters rises up to resist the monarchy, with a showstopping anthem “Freak Flag” that hearkens back to Hair grabbers like “Let the Sunshine In.” The evil one gets his due, love does strange things, and we all live happily ever after.

THEATER REVIEW

Shrek The Musical

Through Jan. 5 at Walnut Street Theatre, 825 Walnut St.

Tickets: $27-$117.

Information: 215-574-3550, walnutstreettheatre.org