I’ve searched months for this and have found it by mistake while thinkering something else in Configuration Editor.
1. Open Configuration Editor (assuming you have it installed already)
2. Expand the ‘org’ group
3. Expand ‘gnome’
4. Expand ‘gnome-panel’
5. Expand ‘layout’
6. Expand ‘toplevels’
7. click on ‘bottom-panel’ and an options window should appear on your right. Check the ‘auto-hide’ box and you should see the bottom panel retracting immediately.
8. click on ‘top-panel’ and an options window should appear on your right. Check the ‘auto-hide’ box and you should see the top panel retracting immediately.
That’s it!