How to get page size

Can I get the width of a page to hide certain things that don’t fit on the screen? For example if the menus at the top of a page don’t fit all when I’m watching the page on a phone how can I determine that the overflowing menus should be hidden?

Your question is off-topic. Development issues not specific to Hugo should be raised elsewhere. You might try Stack Overflow.