How to change margin of content when sidebar shrinks?

I followed a tutorial to design my sidebar (Sidebar Menu using HTML CSS JS | Figma Design to Code | Expandable Side Navigation Bar Explained - YouTube). While I began adding content beside the sidebar, I noticed that as the sidebar had a expand feature, when it shrinks, you can see a space between the sidebar and my content. In order to remove the space, I would like to know how I could change the value of margin-left for my <main> tag when the sidebar is shrinked. Codepen Link. Thank You.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.