JSFiddle - React, Tailwind, and code Playground

HTML

<div class="wrapper">
    <a href="#"><div class="toggle">Toggle</div></a>
    <div class="cart">Cart</div>
</div>

CSS

.wrapper {
    position:fixed;
    width:300px;
    height:100%;
    background-color:orange;
    top:0;
    right:0;
    margin-right:-250px;
}
.toggle {
    position:relative;
    display:block;
    width:50px;
    height:100%;
    background-color:grey;
    float:left;
}
.toggle:active .wrapper {
    margin-right:0px;
}
.cart {
    position: relative;
    width:250px;
    height:100%;
    background-color:red;
    float:right;
}