Making a two-way animation for an element

Hello. I have successfully made a sidebar animate from the right at the press of a button. Now I want it to animate back in to the left at the press of another button. How would I make this happen? I have tried using custom css, but the code disappears every time i try to save it.

You can place custom code in the More → Custom code and then use a class on the element.

But with the native animations you can bind the ‘Reverse’ property based on whether if the sidebar is opened or not.