How to remove top panel shadow when maximized window touches it, in Ubuntu 18.04?

I want to remove the shadow that appears in the top panel when a maximized window touches it. I’m using Ubuntu 18.04. I tried using compizconfig as suggested in this thread: How to remove shadow from gnome-panel? and setting window shadows to ‘none’ or ‘(any) & !(type=Dock)’, but it does not work.
How else can I remove this shadow?