“Everything Is Awesome,” the theme song from the box-office smash “The Lego Movie,” has become a phenomenon among the school-bus set — the music video’s been viewed on YouTube over 30 million times. But likely lost on those little fans is that the song, with its lyrics like “Everything is cool when you’re part of a team,” is dripping with irony.

“I don’t know if kids actually get the degree of sarcasm,” the song’s writers, Shawn Patterson, tells The Post. “ ‘Let’s party forever!’ — if Katy Perry writes it, people just go, ‘Oh yeah, that’s awesome, let’s party!’ When I write it . . . I’m being completely sarcastic.”

While “The Lego Movie” was snubbed in the Best Animated Film category, Patterson is nominated for Best Song at the Oscars. Canadian pop duo Tegan and Sara and the Lonely Island (Andy Samberg’s comedy rap group) recorded it for the movie and will perform live at the awards show.

Patterson, 49, found himself in a tough spot while creating the song for “The Lego Movie”: The Athol, Mass., native was in the midst of a divorce, ending nine years of marriage with the mother of his three children.

Patterson admits the breakup had some influence on the song.

“I think all of us in life have moments [where] you go, ‘Well, is everything awesome right now?’ ” he explains. “You know, your house is on fire and you’re standing on your lawn looking at your house and you go, ‘Man, everything is awesome.’ ”

Sad to say, his ex hasn’t congratulated him on the Oscar nod. “I don’t need her to,” Patterson says, laughing. “Everyone else on the planet has been so kind. I couldn’t care less.”