How to remove margin from MainUI pages

I had this issue for a long time and finaly found the solution. I documented it here.