lowtechweb/assets/styles/menu.sass

114 lines
2.6 KiB
Sass

nav
position: fixed
top: 4*$space
right: 50%
margin-right: $content-width/2
width: 6*$space
font-family: $font-family-monospace
ul
list-style: none
li
border-left: 1px solid $color-primary
padding-left: 15px
text-transform: capitalize
font-size: 0.8*$font-size
&.active
font-weight: $active
a
text-decoration: none
color: $color-primary
&:hover
font-weight: $active
.nav-button
display: none
@media screen and (max-width: 80rem)
body
padding-bottom: 2*$space
nav
display: none
z-index: 10
top: 0
left: 0
width: 100%
height: 100%
background: $color-secondary
&.is-opened
display: block
ul
list-style: none
padding: $space
position: absolute
bottom: $space
right: 0
width: 100%
li
line-height: 1.5*$space
font-size: 1.2*$font-size
text-align: right
border-left: 0
padding: 0
a
text-decoration: none
color: $color-primary
font-weight: 400
&:hover
font-weight: 700
&.active a
font-weight: 700
.nav-button
z-index: 20
display: inherit
border: 0
padding: 0
position: fixed
bottom: 0.5*$space
right: $space
background: transparent !important
&:before
content: 'menu'
text-transform: uppercase
background: $color-secondary
position: fixed
left: 0
width: 100%
height: 2*$space
bottom: 0
padding: 0.9*$space 2*$space 0.6*$space 0
line-height: 0.5*$space
text-align: right
font-size: 0.8*$font-size
&.is-active:before
content: ''
& > *
display: inline-flex
vertical-align: top
flex-direction: column
justify-content: space-between
align-items: stretch
height: 0.4*$space
width: 0.6*$space
background-image: linear-gradient(#333,#333)
background-position: 50%
background-repeat: no-repeat
background-origin: content-box
background-size: 100% 1px
transition: .25s
transition-property: transform,background
will-change: transform,background
& > ::before,& > ::after
content: ""
height: 1px
background: #333
transition: .25s
transition-property: transform,top
will-change: transform,top
&.is-active > *
background-image: none
justify-content: center
&.is-active > ::before
transform: translateY(50%) rotate(45deg)
&.is-active > ::after
transform: translateY(-50%) rotate(-45deg)