datat.fi/_sass/basically-basic/_navicons.scss

126 lines
2.5 KiB
SCSS
Raw Normal View History

/* ==========================================================================
Navicons
========================================================================== */
2017-03-07 23:12:17 +02:00
.navicon-button {
display: inline-block;
position: relative;
margin: 0.90625rem 0;
padding: 0.90625rem 1rem;
2017-03-16 20:34:29 +02:00
transition: $navicon-duration / 2;
border: 0;
outline: none;
2017-03-07 23:12:17 +02:00
background-color: $navicon-nav-bg-close;
2017-03-29 22:12:28 +03:00
line-height: 5 * $navicon-height;
2017-03-07 23:12:17 +02:00
cursor: pointer;
2017-03-16 20:34:29 +02:00
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
2017-03-16 20:34:29 +02:00
user-select: none;
2017-03-07 23:12:17 +02:00
@include breakpoint($medium) {
2017-03-09 17:19:36 +02:00
margin-right: 2rem;
2017-03-07 23:12:17 +02:00
}
@include breakpoint($large) {
2017-03-09 17:19:36 +02:00
margin-right: 5vw;
2017-03-07 23:12:17 +02:00
}
&.open {
background-color: $navicon-nav-bg-open;
}
2017-03-16 20:34:29 +02:00
.navicon::before,
.navicon::after {
2017-03-16 21:13:21 +02:00
transition-duration: $navicon-duration / 2;
2017-03-07 23:12:17 +02:00
}
&:hover {
2017-03-16 21:13:21 +02:00
transition-duration: $navicon-duration;
2017-03-07 23:12:17 +02:00
2017-03-16 20:34:29 +02:00
.navicon::before,
.navicon::after {
2017-03-16 21:13:21 +02:00
transition-duration: $navicon-duration / 2;
2017-03-07 23:12:17 +02:00
}
2017-03-16 20:34:29 +02:00
.navicon::before { top: (2.5 * $navicon-height); }
.navicon::after { top: (-2.5 * $navicon-height); }
2017-03-07 23:12:17 +02:00
}
}
.navicon {
position: relative;
width: $navicon-width;
height: $navicon-height;
2017-03-16 21:13:21 +02:00
transition-duration: $navicon-duration;
2017-03-07 23:12:17 +02:00
border-radius: $navicon-width;
2017-03-16 20:34:29 +02:00
background: $navicon-content-bg;
2017-03-07 23:12:17 +02:00
2017-03-16 20:34:29 +02:00
&::before,
&::after {
2017-03-07 23:12:17 +02:00
display: block;
2017-03-16 20:34:29 +02:00
position: absolute;
2017-03-07 23:12:17 +02:00
width: $navicon-width;
2017-03-16 20:34:29 +02:00
height: $navicon-height;
2017-03-16 21:13:21 +02:00
transition-duration: $navicon-duration $navicon-duration / 2;
2017-03-16 20:34:29 +02:00
border-radius: $navicon-width;
2017-03-07 23:12:17 +02:00
background: $navicon-content-bg;
2017-03-16 20:34:29 +02:00
content: '';
2017-03-07 23:12:17 +02:00
}
2017-03-16 20:34:29 +02:00
&::before { top: (2 * $navicon-height); }
&::after { top: (-2 * $navicon-height); }
2017-03-07 23:12:17 +02:00
}
2017-03-16 20:34:29 +02:00
.open:not(.steps) .navicon::before,
.open:not(.steps) .navicon::after {
2017-03-07 23:12:17 +02:00
top: 0 !important;
}
.open {
2017-03-16 20:34:29 +02:00
transform: scale($navicon-toggled-size);
2017-03-07 23:12:17 +02:00
.navicon::before,
.navicon::after {
transition-duration: $navicon-duration;
2017-03-07 23:12:17 +02:00
}
/* Arrows */
&.larr .navicon,
&.rarr .navicon,
&.uarr .navicon {
2017-03-07 23:12:17 +02:00
&::before,
&::after {
width: (0.6 * $navicon-width);
}
2017-03-07 23:12:17 +02:00
&::before {
transform: rotate(35deg);
transform-origin: left top;
}
2017-03-07 23:12:17 +02:00
&::after {
transform: rotate(-35deg);
transform-origin: left bottom;
}
2017-03-07 23:12:17 +02:00
}
&.uarr {
transform: scale($navicon-toggled-size) rotate(90deg);
2017-03-07 23:12:17 +02:00
}
&.rarr .navicon {
2017-03-07 23:12:17 +02:00
2017-03-16 20:34:29 +02:00
&::before {
transform: translate3d(1em, 0, 0) rotate(-35deg);
transform-origin: right top;
2017-03-07 23:12:17 +02:00
}
2017-03-16 20:34:29 +02:00
&::after {
transform: translate3d(1em, 0, 0) rotate(35deg);
transform-origin: right bottom;
2017-03-07 23:12:17 +02:00
}
}
2017-03-16 20:34:29 +02:00
}