In my application, most of the pages fit within the viewport which is why I have been using height: 100vh
for my <SideNav />
component. However, some pages now require scrolling and this causes issues with the sidebar as it abruptly ends when scrolling starts.
Using height: 100%
does not solve the issue either, in fact, it makes the sidebar even shorter. How can I ensure that the sidebar always stretches the entire length of the page without resorting to using position: absolute
, which would require setting fixed left margins on other content?
It's worth mentioning that I am working with React and styled-components.