home-assistant.github.io/sass/oscailte/base/_navigation.scss
Paulus Schoutsen b0bdfe2fe9 Update to site
2014-12-21 12:17:37 -08:00

106 lines
No EOL
2.6 KiB
SCSS

/*
* Navigataur: A pure CSS responsive navigation menu
* Author: Mike King (@micjamking)
*/
/*--------------------------------
Functional Styles (Required)
---------------------------------*/
/* Tim Pietrusky advanced checkbox hack (Android <= 4.1.2) */
body{ -webkit-animation: bugfix infinite 1s; }
@-webkit-keyframes bugfix { from {padding:0;} to {padding:0;} }
.header { position: relative; }
#toggle, .toggle { display: none; }
.menu > li { list-style: none; float:left; }
@media only screen and (max-width: $lap-end){
.menu { display: none; opacity: 0; width: 100%; position: absolute; right: 0; }
.menu > li { display: block; width: 100%; margin: 0; }
.menu > li > a { display: block; width: 100%; text-decoration: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
.toggle { display: block; position: relative; cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
#toggle:checked ~ .menu { display: block; opacity: 1; z-index: 999; }
}
/*--------------------------------
Presentation Styles (Editable)
---------------------------------*/
.menu {
margin: 0;
}
.menu > li > a{
@include box-sizing(border-box);
@include transition(all 0.25s linear);
display: block;
padding: 32px 20px;
text-decoration: none;
font-weight: normal;
font-size: 16px;
line-height: 1;
}
.menu > li > a:hover, .menu > li > a:focus{
background: $site-background;
box-shadow: inset 0px 5px $navigation-color;
color: $navigation-color;
padding: 40px 20px 24px;
}
.toggle{
z-index: 20;
}
@media only screen and (max-width: $lap-end){
.menu{
background: $white;
border-top: 1px solid $navigation-color;
border-bottom: 4px solid $navigation-color;
}
.menu, .menu > li, .menu > li > a{
height: auto;
}
.menu > li > a{
padding: 15px 15px;
}
.menu > li > a:hover, .menu > li > a:focus{
background: $grayLighter;
box-shadow: inset 5px 0px $navigation-color;
padding: 15px 15px 15px 25px;
}
.toggle::after {
@include border-radius(2px);
@include box-sizing(border-box);
@include transition(all 0.5s linear);
content: attr(data-open);
display: block;
width: 100%;
margin: 20px 0;
padding: 10px 50px;
background: $navigation-color;
text-align: center;
font-size: 12px;
color: $white;
}
.toggle:hover::after{
background: darken($navigation-color, 7%);
}
#toggle:checked + .toggle::after{
content: attr(data-close);
}
}
@media only screen and (max-width: 479px){
.toggle::after {
margin: 0 0 20px;
text-align: center;
width: 100%;
}
}