-
Hello, we have tried implementing @NikRoe's suggestion to fade out the hamburger menu overlay after clicking the close button, so it matches the opening animation (ty for that! We agree). We made two different keyframes animations and via state, we want to trigger one or the other, based on a true or false state. Our code so far looks like this: const customAnimationIn = keyframes const customAnimationOut = keyframes animation: ${({ $hamburgerOpen }) => With our prop We will also later have to implement a time out function so that our close button doesn't react abruptly. Thanks in advance for your ideas! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi there, the error message suggests that in addition to the keyframe helper, you will also need the css helper from styled-components. ${({ $hamburgerOpen }) => css`
animation: ${$hamburgerOpen ? customAnimationIn : customAnimationOut} 100ms
ease-in-out forwards;
`}
Hope this already enables you to take the next steps in finding a great fade out animation :) |
Beta Was this translation helpful? Give feedback.
Hi there,
the error message suggests that in addition to the keyframe helper, you will also need the css helper from styled-components.
Those lines of code would then look like this:
Hope this already enables you to take the next steps in finding a great fade out animation :)