More elegant solution for navbar resizing