Skip to content

Instantly share code, notes, and snippets.

@user44
Created October 7, 2016 14:41
Show Gist options
  • Save user44/e05cb42e742a674530178d7da2b82e41 to your computer and use it in GitHub Desktop.
Save user44/e05cb42e742a674530178d7da2b82e41 to your computer and use it in GitHub Desktop.
HTML
<div class="mobile-menu-toggle"><span></span></div>
SASS
.mobile-menu-toggle
display: block
width: 30px
height: 23px
margin: 30px auto 10px
cursor: pointer
span
&:after, &:before
content: ""
position: absolute
left: 0
top: 9px
&:after
top: 18px
width: 100%
height: 5px
background-color: #888
transition: all 0.3s
backface-visibility: hidden
border-radius: 2px
position: relative
display: block
width: 100%
height: 5px
background-color: #888
transition: all 0.3s
backface-visibility: hidden
border-radius: 2px
&:before
width: 100%
height: 5px
background-color: #888
transition: all 0.3s
backface-visibility: hidden
border-radius: 2px
&.on
span
// transform-origin: left top
transform: rotate(45deg) translate3d(6px, 7px, 0)
&:before
background-color: transparent
transform: rotate(-45deg) translate3d(6px, -7px, 0)
// transition: none
&:after
// transform-origin: left bottom
transform: rotate(-90deg) translate3d(18px, 0px, 0)
+ #menu
opacity: 1
visibility: visible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment