
This gnome-shell extension automatically hides the topbar, except in overview. There is also an option to show the topbar when the mouse pointer approaches the edge of the screen.
Please note that you have to manually enable the extension, for example using gnome-tweak-tool.