What about something like "copyCssWithMediaToStyleNode"?

I propose moving the logic into the method and have it take $cssParts instead of $cssParts['media'].