You can do it by setting the line-height on the <a> element that contains the logo to equal to the max-height of the logo. That should work for all cases except for when the logo max-height is changed in a customization.
<a class="logo-link" data-auto-route="true" href="/">
<img id="site-logo" class="logo-big" src="https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/3X/9/d/9d543e92b15b06924249654667a81441a55867eb.png" alt="Discourse Meta">
</a>
a.logo-link {
line-height: 40px;
}
I’ve reduced the size of the logo here and but it stays centered.

