I can't think of a way to do this dynamically. If I were to redesign this component, I would have the panes be part of the component, so we could do more smarts and unify their styling as well (and avoid the it-is-transformed-offscreen-and-therefore-it-is-hidden pitfall).

If you go ahead with that approach (or you want me to take a shot at it), note that the panes would still need to be separate from the tabs and not collated together like they often are now in parts of gaia.