Replies: 2 comments
-
There are simple ways to do this with JS: https://stackoverflow.com/questions/1229688/how-can-i-erase-all-inline-styles-with-javascript-and-leave-only-the-styles-spec But given that you have a desktop and mobile menu with different interactions I suggest making them separate components entirely and conditionally rendering them based on the viewport width. |
Beta Was this translation helpful? Give feedback.
-
Thank you! I already thought about creating two different Navs but this would increase the bundle size and is in my opinion not necessary but do you have an example or resource I could look at about "conditionally rendering them based on the viewport width"? |
Beta Was this translation helpful? Give feedback.
-
🤓 Question
Is it possible to remove the styling from an element at a later point? I'm animating a mobile navigation which should only animate below viewport width X and all above should remove the styling so the desktop nav doesn't get props like
width: 0
.Beta Was this translation helpful? Give feedback.
All reactions