diff --git a/CHANGELOG.md b/CHANGELOG.md index 32516f9..febf724 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ Changelog for Hamburgers. +## [0.5.0] - 04/04/2016 +### Fixed +- `Error: Import directives may not be used within control directives or mixins.` in certain cases like when compiling with Ruby Sass. +Solution: `@import` all available types and instead nest Sass for each type in `@if` directive which checks to see if the type exists in `$hamburger-types`. e.g.: +```scss +@if index($hamburger-types, 3dx) { + .hamburger--3dx { + } +} +``` + ## [0.4.0] - 03/28/2016 ### Improved - Customize the including/excluding of hamburger types in settings as `$hamburger-types` Sass list (e.g. If someone includes Hamburgers via npm or Bower, they don’t have to modify the source files in `node_modules` or `bower_components`.) diff --git a/_sass/hamburgers/hamburgers.scss b/_sass/hamburgers/hamburgers.scss index a493e14..66f4f0c 100644 --- a/_sass/hamburgers/hamburgers.scss +++ b/_sass/hamburgers/hamburgers.scss @@ -60,83 +60,47 @@ $hamburger-types: ( // ================================================== @import "base"; -// Include/exclude based on $hamburger-types +// Hamburger types (Each should have an @if directive // ================================================== -@if index($hamburger-types, 3dx) { - @import "types/3dx"; -} -@if index($hamburger-types, 3dx-r) { - @import "types/3dx-r"; -} -@if index($hamburger-types, 3dy) { - @import "types/3dy"; -} -@if index($hamburger-types, 3dy-r) { - @import "types/3dy-r"; -} -@if index($hamburger-types, arrow) { - @import "types/arrow"; -} -@if index($hamburger-types, arrow-r) { - @import "types/arrow-r"; -} -@if index($hamburger-types, arrowalt) { - @import "types/arrowalt"; -} -@if index($hamburger-types, arrowalt-r) { - @import "types/arrowalt-r"; -} -@if index($hamburger-types, boring) { - @import "types/boring"; -} -@if index($hamburger-types, collapse) { - @import "types/collapse"; -} -@if index($hamburger-types, collapse-r) { - @import "types/collapse-r"; -} -@if index($hamburger-types, elastic) { - @import "types/elastic"; -} -@if index($hamburger-types, elastic-r) { - @import "types/elastic-r"; -} -@if index($hamburger-types, emphatic) { - @import "types/emphatic"; -} -@if index($hamburger-types, emphatic-r) { - @import "types/emphatic-r"; -} -@if index($hamburger-types, slider) { - @import "types/slider"; -} -@if index($hamburger-types, slider-r) { - @import "types/slider-r"; -} -@if index($hamburger-types, spring) { - @import "types/spring"; -} -@if index($hamburger-types, spring-r) { - @import "types/spring-r"; -} -@if index($hamburger-types, stand) { - @import "types/stand"; -} -@if index($hamburger-types, stand-r) { - @import "types/stand-r"; -} -@if index($hamburger-types, spin) { - @import "types/spin"; -} -@if index($hamburger-types, spin-r) { - @import "types/spin-r"; -} -@if index($hamburger-types, squeeze) { - @import "types/squeeze"; -} -@if index($hamburger-types, vortex) { - @import "types/vortex"; -} -@if index($hamburger-types, vortex-r) { - @import "types/vortex-r"; -} +@import "types/3dx"; +@import "types/3dx-r"; +@import "types/3dy"; +@import "types/3dy-r"; +@import "types/arrow"; +@import "types/arrow-r"; +@import "types/arrowalt"; +@import "types/arrowalt-r"; +@import "types/boring"; +@import "types/collapse"; +@import "types/collapse-r"; +@import "types/elastic"; +@import "types/elastic-r"; +@import "types/emphatic"; +@import "types/emphatic-r"; +@import "types/slider"; +@import "types/slider-r"; +@import "types/spring"; +@import "types/spring-r"; +@import "types/stand"; +@import "types/stand-r"; +@import "types/spin"; +@import "types/spin-r"; +@import "types/squeeze"; +@import "types/vortex"; +@import "types/vortex-r"; + +// ================================================== +// Cooking up additional types: +// +// The Sass for each hamburger type should be nested +// inside an @if directive to check whether or not +// it exists in $hamburger-types so only the CSS for +// included types are generated. +// +// e.g. hamburgers/types/_new-type.scss +// +// @if index($hamburger-types, new-type) { +// .hamburger--new-type { +// ... +// } +// } diff --git a/_sass/hamburgers/types/_3dx-r.scss b/_sass/hamburgers/types/_3dx-r.scss index 431dc72..25712b6 100644 --- a/_sass/hamburgers/types/_3dx-r.scss +++ b/_sass/hamburgers/types/_3dx-r.scss @@ -1,32 +1,34 @@ -/* - * 3DX Reverse - */ -.hamburger--3dx-r { - .hamburger-box { - perspective: $hamburger-layer-width * 2; - } - - .hamburger-inner { - transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), - background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); - - &::before, - &::after { - transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); +@if index($hamburger-types, 3dx-r) { + /* + * 3DX Reverse + */ + .hamburger--3dx-r { + .hamburger-box { + perspective: $hamburger-layer-width * 2; } - } - &.is-active { .hamburger-inner { - background-color: transparent; - transform: rotateY(-180deg); + transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), + background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); - &::before { - transform: translate3d(0, $hamburger-layer-height + $hamburger-layer-spacing, 0) rotate(45deg); + &::before, + &::after { + transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + } - &::after { - transform: translate3d(0, ($hamburger-layer-height + $hamburger-layer-spacing) * -1, 0) rotate(-45deg); + &.is-active { + .hamburger-inner { + background-color: transparent; + transform: rotateY(-180deg); + + &::before { + transform: translate3d(0, $hamburger-layer-height + $hamburger-layer-spacing, 0) rotate(45deg); + } + + &::after { + transform: translate3d(0, ($hamburger-layer-height + $hamburger-layer-spacing) * -1, 0) rotate(-45deg); + } } } } diff --git a/_sass/hamburgers/types/_3dx.scss b/_sass/hamburgers/types/_3dx.scss index c4b4777..65e45cb 100644 --- a/_sass/hamburgers/types/_3dx.scss +++ b/_sass/hamburgers/types/_3dx.scss @@ -1,32 +1,34 @@ -/* - * 3DX - */ -.hamburger--3dx { - .hamburger-box { - perspective: $hamburger-layer-width * 2; - } - - .hamburger-inner { - transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), - background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); - - &::before, - &::after { - transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); +@if index($hamburger-types, 3dx) { + /* + * 3DX + */ + .hamburger--3dx { + .hamburger-box { + perspective: $hamburger-layer-width * 2; } - } - &.is-active { .hamburger-inner { - background-color: transparent; - transform: rotateY(180deg); + transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), + background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); - &::before { - transform: translate3d(0, $hamburger-layer-height + $hamburger-layer-spacing, 0) rotate(45deg); + &::before, + &::after { + transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + } - &::after { - transform: translate3d(0, ($hamburger-layer-height + $hamburger-layer-spacing) * -1, 0) rotate(-45deg); + &.is-active { + .hamburger-inner { + background-color: transparent; + transform: rotateY(180deg); + + &::before { + transform: translate3d(0, $hamburger-layer-height + $hamburger-layer-spacing, 0) rotate(45deg); + } + + &::after { + transform: translate3d(0, ($hamburger-layer-height + $hamburger-layer-spacing) * -1, 0) rotate(-45deg); + } } } } diff --git a/_sass/hamburgers/types/_3dy-r.scss b/_sass/hamburgers/types/_3dy-r.scss index 0577fa5..6b89ea1 100644 --- a/_sass/hamburgers/types/_3dy-r.scss +++ b/_sass/hamburgers/types/_3dy-r.scss @@ -1,32 +1,34 @@ -/* - * 3DY Reverse - */ -.hamburger--3dy-r { - .hamburger-box { - perspective: $hamburger-layer-width * 2; - } - - .hamburger-inner { - transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), - background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); - - &::before, - &::after { - transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); +@if index($hamburger-types, 3dy-r) { + /* + * 3DY Reverse + */ + .hamburger--3dy-r { + .hamburger-box { + perspective: $hamburger-layer-width * 2; } - } - &.is-active { .hamburger-inner { - background-color: transparent; - transform: rotateX(180deg); + transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), + background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); - &::before { - transform: translate3d(0, $hamburger-layer-height + $hamburger-layer-spacing, 0) rotate(45deg); + &::before, + &::after { + transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + } - &::after { - transform: translate3d(0, ($hamburger-layer-height + $hamburger-layer-spacing) * -1, 0) rotate(-45deg); + &.is-active { + .hamburger-inner { + background-color: transparent; + transform: rotateX(180deg); + + &::before { + transform: translate3d(0, $hamburger-layer-height + $hamburger-layer-spacing, 0) rotate(45deg); + } + + &::after { + transform: translate3d(0, ($hamburger-layer-height + $hamburger-layer-spacing) * -1, 0) rotate(-45deg); + } } } } diff --git a/_sass/hamburgers/types/_3dy.scss b/_sass/hamburgers/types/_3dy.scss index f347711..bfeea60 100644 --- a/_sass/hamburgers/types/_3dy.scss +++ b/_sass/hamburgers/types/_3dy.scss @@ -1,32 +1,34 @@ -/* - * 3DY - */ -.hamburger--3dy { - .hamburger-box { - perspective: $hamburger-layer-width * 2; - } - - .hamburger-inner { - transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), - background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); - - &::before, - &::after { - transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); +@if index($hamburger-types, 3dy) { + /* + * 3DY + */ + .hamburger--3dy { + .hamburger-box { + perspective: $hamburger-layer-width * 2; } - } - &.is-active { .hamburger-inner { - background-color: transparent; - transform: rotateX(-180deg); + transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), + background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); - &::before { - transform: translate3d(0, $hamburger-layer-height + $hamburger-layer-spacing, 0) rotate(45deg); + &::before, + &::after { + transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + } - &::after { - transform: translate3d(0, ($hamburger-layer-height + $hamburger-layer-spacing) * -1, 0) rotate(-45deg); + &.is-active { + .hamburger-inner { + background-color: transparent; + transform: rotateX(-180deg); + + &::before { + transform: translate3d(0, $hamburger-layer-height + $hamburger-layer-spacing, 0) rotate(45deg); + } + + &::after { + transform: translate3d(0, ($hamburger-layer-height + $hamburger-layer-spacing) * -1, 0) rotate(-45deg); + } } } } diff --git a/_sass/hamburgers/types/_arrow-r.scss b/_sass/hamburgers/types/_arrow-r.scss index 0d203cf..bb77ae9 100644 --- a/_sass/hamburgers/types/_arrow-r.scss +++ b/_sass/hamburgers/types/_arrow-r.scss @@ -1,14 +1,16 @@ -/* - * Arrow Right - */ -.hamburger--arrow-r.is-active { - .hamburger-inner { - &::before { - transform: translate3d($hamburger-layer-width * 0.2, 0, 0) rotate(45deg) scale(0.7, 1); - } +@if index($hamburger-types, arrow-r) { + /* + * Arrow Right + */ + .hamburger--arrow-r.is-active { + .hamburger-inner { + &::before { + transform: translate3d($hamburger-layer-width * 0.2, 0, 0) rotate(45deg) scale(0.7, 1); + } - &::after { - transform: translate3d($hamburger-layer-width * 0.2, 0, 0) rotate(-45deg) scale(0.7, 1); + &::after { + transform: translate3d($hamburger-layer-width * 0.2, 0, 0) rotate(-45deg) scale(0.7, 1); + } } } } diff --git a/_sass/hamburgers/types/_arrow.scss b/_sass/hamburgers/types/_arrow.scss index 65cce34..a5946a6 100644 --- a/_sass/hamburgers/types/_arrow.scss +++ b/_sass/hamburgers/types/_arrow.scss @@ -1,14 +1,16 @@ -/* - * Arrow - */ -.hamburger--arrow.is-active { - .hamburger-inner { - &::before { - transform: translate3d($hamburger-layer-width * -0.2, 0, 0) rotate(-45deg) scale(0.7, 1); - } +@if index($hamburger-types, arrow) { + /* + * Arrow + */ + .hamburger--arrow.is-active { + .hamburger-inner { + &::before { + transform: translate3d($hamburger-layer-width * -0.2, 0, 0) rotate(-45deg) scale(0.7, 1); + } - &::after { - transform: translate3d($hamburger-layer-width * -0.2, 0, 0) rotate(45deg) scale(0.7, 1); + &::after { + transform: translate3d($hamburger-layer-width * -0.2, 0, 0) rotate(45deg) scale(0.7, 1); + } } } } diff --git a/_sass/hamburgers/types/_arrowalt-r.scss b/_sass/hamburgers/types/_arrowalt-r.scss index 3297b33..a8a43c1 100644 --- a/_sass/hamburgers/types/_arrowalt-r.scss +++ b/_sass/hamburgers/types/_arrowalt-r.scss @@ -1,33 +1,35 @@ -/* - * Arrow Alt Right - */ -.hamburger--arrowalt-r { - .hamburger-inner { - &::before { - transition: top 0.1s 0.15s ease, - transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); - } - - &::after { - transition: bottom 0.1s 0.15s ease, - transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); - } - } - - &.is-active { +@if index($hamburger-types, arrowalt-r) { + /* + * Arrow Alt Right + */ + .hamburger--arrowalt-r { .hamburger-inner { &::before { - top: 0; - transform: translate3d($hamburger-layer-width * 0.2, $hamburger-layer-width * -0.25, 0) rotate(45deg) scale(0.7, 1); - transition: top 0.1s ease, - transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); + transition: top 0.1s 0.15s ease, + transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); } &::after { - bottom: 0; - transform: translate3d($hamburger-layer-width * 0.2, $hamburger-layer-width * 0.25, 0) rotate(-45deg) scale(0.7, 1); - transition: bottom 0.1s ease, - transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); + transition: bottom 0.1s 0.15s ease, + transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); + } + } + + &.is-active { + .hamburger-inner { + &::before { + top: 0; + transform: translate3d($hamburger-layer-width * 0.2, $hamburger-layer-width * -0.25, 0) rotate(45deg) scale(0.7, 1); + transition: top 0.1s ease, + transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); + } + + &::after { + bottom: 0; + transform: translate3d($hamburger-layer-width * 0.2, $hamburger-layer-width * 0.25, 0) rotate(-45deg) scale(0.7, 1); + transition: bottom 0.1s ease, + transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); + } } } } diff --git a/_sass/hamburgers/types/_arrowalt.scss b/_sass/hamburgers/types/_arrowalt.scss index 1ea2ca1..68eadf0 100644 --- a/_sass/hamburgers/types/_arrowalt.scss +++ b/_sass/hamburgers/types/_arrowalt.scss @@ -1,33 +1,35 @@ -/* - * Arrow Alt - */ -.hamburger--arrowalt { - .hamburger-inner { - &::before { - transition: top 0.1s 0.15s ease, - transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); - } - - &::after { - transition: bottom 0.1s 0.15s ease, - transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); - } - } - - &.is-active { +@if index($hamburger-types, arrowalt) { + /* + * Arrow Alt + */ + .hamburger--arrowalt { .hamburger-inner { &::before { - top: 0; - transform: translate3d($hamburger-layer-width * -0.2, $hamburger-layer-width * -0.25, 0) rotate(-45deg) scale(0.7, 1); - transition: top 0.1s ease, - transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); + transition: top 0.1s 0.15s ease, + transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); } &::after { - bottom: 0; - transform: translate3d($hamburger-layer-width * -0.2, $hamburger-layer-width * 0.25, 0) rotate(45deg) scale(0.7, 1); - transition: bottom 0.1s ease, - transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); + transition: bottom 0.1s 0.15s ease, + transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); + } + } + + &.is-active { + .hamburger-inner { + &::before { + top: 0; + transform: translate3d($hamburger-layer-width * -0.2, $hamburger-layer-width * -0.25, 0) rotate(-45deg) scale(0.7, 1); + transition: top 0.1s ease, + transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); + } + + &::after { + bottom: 0; + transform: translate3d($hamburger-layer-width * -0.2, $hamburger-layer-width * 0.25, 0) rotate(45deg) scale(0.7, 1); + transition: bottom 0.1s ease, + transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); + } } } } diff --git a/_sass/hamburgers/types/_boring.scss b/_sass/hamburgers/types/_boring.scss index 2c6c250..23214b4 100644 --- a/_sass/hamburgers/types/_boring.scss +++ b/_sass/hamburgers/types/_boring.scss @@ -1,27 +1,29 @@ -/* - * Boring - */ -.hamburger--boring { - .hamburger-inner { - &, - &::before, - &::after { - transition-property: none; +@if index($hamburger-types, boring) { + /* + * Boring + */ + .hamburger--boring { + .hamburger-inner { + &, + &::before, + &::after { + transition-property: none; + } } - } - &.is-active { - .hamburger-inner { - transform: rotate(45deg); + &.is-active { + .hamburger-inner { + transform: rotate(45deg); - &::before { - top: 0; - opacity: 0; - } + &::before { + top: 0; + opacity: 0; + } - &::after { - bottom: 0; - transform: rotate(-90deg); + &::after { + bottom: 0; + transform: rotate(-90deg); + } } } } diff --git a/_sass/hamburgers/types/_collapse-r.scss b/_sass/hamburgers/types/_collapse-r.scss index 7b25488..d9a401d 100644 --- a/_sass/hamburgers/types/_collapse-r.scss +++ b/_sass/hamburgers/types/_collapse-r.scss @@ -1,44 +1,46 @@ -/* - * Collapse Reverse - */ -.hamburger--collapse-r { - .hamburger-inner { - top: auto; - bottom: 0; - transition-duration: 0.15s; - transition-delay: 0.15s; - transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); - - &::after { - top: ($hamburger-layer-spacing * 2 + $hamburger-layer-height * 2) * -1; - transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), - opacity 0.1s linear; - } - - &::before { - transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), - transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); - } - } - - &.is-active { +@if index($hamburger-types, collapse-r) { + /* + * Collapse Reverse + */ + .hamburger--collapse-r { .hamburger-inner { - transform: translate3d(0, ($hamburger-layer-spacing + $hamburger-layer-height) * -1, 0) rotate(45deg); - transition-delay: 0.32s; - transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + top: auto; + bottom: 0; + transition-duration: 0.15s; + transition-delay: 0.15s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); &::after { - top: 0; - opacity: 0; - transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), - opacity 0.1s 0.27s linear; + top: ($hamburger-layer-spacing * 2 + $hamburger-layer-height * 2) * -1; + transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), + opacity 0.1s linear; } &::before { - top: 0; - transform: rotate(90deg); - transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), - transform 0.15s 0.42s cubic-bezier(0.215, 0.61, 0.355, 1); + transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), + transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + } + + &.is-active { + .hamburger-inner { + transform: translate3d(0, ($hamburger-layer-spacing + $hamburger-layer-height) * -1, 0) rotate(45deg); + transition-delay: 0.32s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + + &::after { + top: 0; + opacity: 0; + transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), + opacity 0.1s 0.27s linear; + } + + &::before { + top: 0; + transform: rotate(90deg); + transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), + transform 0.15s 0.42s cubic-bezier(0.215, 0.61, 0.355, 1); + } } } } diff --git a/_sass/hamburgers/types/_collapse.scss b/_sass/hamburgers/types/_collapse.scss index 0d80d5d..ac6a676 100644 --- a/_sass/hamburgers/types/_collapse.scss +++ b/_sass/hamburgers/types/_collapse.scss @@ -1,44 +1,46 @@ -/* - * Collapse - */ -.hamburger--collapse { - .hamburger-inner { - top: auto; - bottom: 0; - transition-duration: 0.15s; - transition-delay: 0.15s; - transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); - - &::after { - top: ($hamburger-layer-spacing * 2 + $hamburger-layer-height * 2) * -1; - transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), - opacity 0.1s linear; - } - - &::before { - transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), - transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); - } - } - - &.is-active { +@if index($hamburger-types, collapse) { + /* + * Collapse + */ + .hamburger--collapse { .hamburger-inner { - transform: translate3d(0, ($hamburger-layer-spacing + $hamburger-layer-height) * -1, 0) rotate(-45deg); - transition-delay: 0.32s; - transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + top: auto; + bottom: 0; + transition-duration: 0.15s; + transition-delay: 0.15s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); &::after { - top: 0; - opacity: 0; - transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), - opacity 0.1s 0.27s linear; + top: ($hamburger-layer-spacing * 2 + $hamburger-layer-height * 2) * -1; + transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), + opacity 0.1s linear; } &::before { - top: 0; - transform: rotate(-90deg); - transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), - transform 0.15s 0.42s cubic-bezier(0.215, 0.61, 0.355, 1); + transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), + transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + } + + &.is-active { + .hamburger-inner { + transform: translate3d(0, ($hamburger-layer-spacing + $hamburger-layer-height) * -1, 0) rotate(-45deg); + transition-delay: 0.32s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + + &::after { + top: 0; + opacity: 0; + transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), + opacity 0.1s 0.27s linear; + } + + &::before { + top: 0; + transform: rotate(-90deg); + transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), + transform 0.15s 0.42s cubic-bezier(0.215, 0.61, 0.355, 1); + } } } } diff --git a/_sass/hamburgers/types/_elastic-r.scss b/_sass/hamburgers/types/_elastic-r.scss index 40694d5..fb039d9 100644 --- a/_sass/hamburgers/types/_elastic-r.scss +++ b/_sass/hamburgers/types/_elastic-r.scss @@ -1,38 +1,40 @@ -/* - * Elastic Reverse - */ -.hamburger--elastic-r { - .hamburger-inner { - top: $hamburger-layer-height / 2; - transition-duration: 0.4s; - transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); - - &::before { - top: $hamburger-layer-height + $hamburger-layer-spacing; - transition: opacity 0.15s 0.4s ease; - } - - &::after { - top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2); - transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); - } - } - - &.is-active { +@if index($hamburger-types, elastic-r) { + /* + * Elastic Reverse + */ + .hamburger--elastic-r { .hamburger-inner { - $y-offset: $hamburger-layer-spacing + $hamburger-layer-height; - - transform: translate3d(0, $y-offset, 0) rotate(-135deg); - transition-delay: 0.1s; + top: $hamburger-layer-height / 2; + transition-duration: 0.4s; + transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); &::before { - transition-delay: 0s; - opacity: 0; + top: $hamburger-layer-height + $hamburger-layer-spacing; + transition: opacity 0.15s 0.4s ease; } &::after { - transform: translate3d(0, $y-offset * -2, 0) rotate(270deg); + top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2); + transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); + } + } + + &.is-active { + .hamburger-inner { + $y-offset: $hamburger-layer-spacing + $hamburger-layer-height; + + transform: translate3d(0, $y-offset, 0) rotate(-135deg); transition-delay: 0.1s; + + &::before { + transition-delay: 0s; + opacity: 0; + } + + &::after { + transform: translate3d(0, $y-offset * -2, 0) rotate(270deg); + transition-delay: 0.1s; + } } } } diff --git a/_sass/hamburgers/types/_elastic.scss b/_sass/hamburgers/types/_elastic.scss index c96e98c..98638c9 100644 --- a/_sass/hamburgers/types/_elastic.scss +++ b/_sass/hamburgers/types/_elastic.scss @@ -1,38 +1,40 @@ -/* - * Elastic - */ -.hamburger--elastic { - .hamburger-inner { - top: $hamburger-layer-height / 2; - transition-duration: 0.4s; - transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); - - &::before { - top: $hamburger-layer-height + $hamburger-layer-spacing; - transition: opacity 0.15s 0.4s ease; - } - - &::after { - top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2); - transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); - } - } - - &.is-active { +@if index($hamburger-types, elastic) { + /* + * Elastic + */ + .hamburger--elastic { .hamburger-inner { - $y-offset: $hamburger-layer-spacing + $hamburger-layer-height; - - transform: translate3d(0, $y-offset, 0) rotate(135deg); - transition-delay: 0.1s; + top: $hamburger-layer-height / 2; + transition-duration: 0.4s; + transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); &::before { - transition-delay: 0s; - opacity: 0; + top: $hamburger-layer-height + $hamburger-layer-spacing; + transition: opacity 0.15s 0.4s ease; } &::after { - transform: translate3d(0, $y-offset * -2, 0) rotate(-270deg); + top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2); + transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); + } + } + + &.is-active { + .hamburger-inner { + $y-offset: $hamburger-layer-spacing + $hamburger-layer-height; + + transform: translate3d(0, $y-offset, 0) rotate(135deg); transition-delay: 0.1s; + + &::before { + transition-delay: 0s; + opacity: 0; + } + + &::after { + transform: translate3d(0, $y-offset * -2, 0) rotate(-270deg); + transition-delay: 0.1s; + } } } } diff --git a/_sass/hamburgers/types/_emphatic-r.scss b/_sass/hamburgers/types/_emphatic-r.scss index f2e1fcf..e6a1d4a 100644 --- a/_sass/hamburgers/types/_emphatic-r.scss +++ b/_sass/hamburgers/types/_emphatic-r.scss @@ -1,50 +1,52 @@ -/* - * Emphatic Reverse - */ -.hamburger--emphatic-r { - overflow: hidden; +@if index($hamburger-types, emphatic-r) { + /* + * Emphatic Reverse + */ + .hamburger--emphatic-r { + overflow: hidden; - .hamburger-inner { - transition: background-color 0.2s 0.25s ease-in; - - &::before { - left: 0; - transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), - top 0.05s 0.2s linear, - left 0.2s 0.25s ease-in; - } - - &::after { - top: ($hamburger-layer-height) + ($hamburger-layer-spacing); - right: 0; - transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), - top 0.05s 0.2s linear, - right 0.2s 0.25s ease-in; - } - } - - &.is-active { .hamburger-inner { - transition-delay: 0s; - transition-timing-function: ease-out; - background-color: transparent; + transition: background-color 0.2s 0.25s ease-in; &::before { - left: $hamburger-layer-width * -2; - top: $hamburger-layer-width * 2; - transform: translate3d($hamburger-layer-width * 2, $hamburger-layer-width * -2, 0) rotate(-45deg); - transition: left 0.2s ease-out, + left: 0; + transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), top 0.05s 0.2s linear, - transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); + left 0.2s 0.25s ease-in; } &::after { - right: $hamburger-layer-width * -2; - top: $hamburger-layer-width * 2; - transform: translate3d($hamburger-layer-width * -2, $hamburger-layer-width * -2, 0) rotate(45deg); - transition: right 0.2s ease-out, + top: ($hamburger-layer-height) + ($hamburger-layer-spacing); + right: 0; + transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), top 0.05s 0.2s linear, - transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); + right 0.2s 0.25s ease-in; + } + } + + &.is-active { + .hamburger-inner { + transition-delay: 0s; + transition-timing-function: ease-out; + background-color: transparent; + + &::before { + left: $hamburger-layer-width * -2; + top: $hamburger-layer-width * 2; + transform: translate3d($hamburger-layer-width * 2, $hamburger-layer-width * -2, 0) rotate(-45deg); + transition: left 0.2s ease-out, + top 0.05s 0.2s linear, + transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); + } + + &::after { + right: $hamburger-layer-width * -2; + top: $hamburger-layer-width * 2; + transform: translate3d($hamburger-layer-width * -2, $hamburger-layer-width * -2, 0) rotate(45deg); + transition: right 0.2s ease-out, + top 0.05s 0.2s linear, + transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); + } } } } diff --git a/_sass/hamburgers/types/_emphatic.scss b/_sass/hamburgers/types/_emphatic.scss index a85f45e..fded73c 100644 --- a/_sass/hamburgers/types/_emphatic.scss +++ b/_sass/hamburgers/types/_emphatic.scss @@ -1,50 +1,52 @@ -/* - * Emphatic - */ -.hamburger--emphatic { - overflow: hidden; +@if index($hamburger-types, emphatic) { + /* + * Emphatic + */ + .hamburger--emphatic { + overflow: hidden; - .hamburger-inner { - transition: background-color 0.2s 0.25s ease-in; - - &::before { - left: 0; - transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), - top 0.05s 0.2s linear, - left 0.2s 0.25s ease-in; - } - - &::after { - top: ($hamburger-layer-height) + ($hamburger-layer-spacing); - right: 0; - transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), - top 0.05s 0.2s linear, - right 0.2s 0.25s ease-in; - } - } - - &.is-active { .hamburger-inner { - transition-delay: 0s; - transition-timing-function: ease-out; - background-color: transparent; + transition: background-color 0.2s 0.25s ease-in; &::before { - left: $hamburger-layer-width * -2; - top: $hamburger-layer-width * -2; - transform: translate3d($hamburger-layer-width * 2, $hamburger-layer-width * 2, 0) rotate(45deg); - transition: left 0.2s ease-out, + left: 0; + transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), top 0.05s 0.2s linear, - transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); + left 0.2s 0.25s ease-in; } &::after { - right: $hamburger-layer-width * -2; - top: $hamburger-layer-width * -2; - transform: translate3d($hamburger-layer-width * -2, $hamburger-layer-width * 2, 0) rotate(-45deg); - transition: right 0.2s ease-out, + top: ($hamburger-layer-height) + ($hamburger-layer-spacing); + right: 0; + transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), top 0.05s 0.2s linear, - transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); + right 0.2s 0.25s ease-in; + } + } + + &.is-active { + .hamburger-inner { + transition-delay: 0s; + transition-timing-function: ease-out; + background-color: transparent; + + &::before { + left: $hamburger-layer-width * -2; + top: $hamburger-layer-width * -2; + transform: translate3d($hamburger-layer-width * 2, $hamburger-layer-width * 2, 0) rotate(45deg); + transition: left 0.2s ease-out, + top 0.05s 0.2s linear, + transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); + } + + &::after { + right: $hamburger-layer-width * -2; + top: $hamburger-layer-width * -2; + transform: translate3d($hamburger-layer-width * -2, $hamburger-layer-width * 2, 0) rotate(-45deg); + transition: right 0.2s ease-out, + top 0.05s 0.2s linear, + transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); + } } } } diff --git a/_sass/hamburgers/types/_slider-r.scss b/_sass/hamburgers/types/_slider-r.scss index d50a3e6..8b3ec53 100644 --- a/_sass/hamburgers/types/_slider-r.scss +++ b/_sass/hamburgers/types/_slider-r.scss @@ -1,35 +1,37 @@ -/* - * Slider Reverse - */ -.hamburger--slider-r { - .hamburger-inner { - top: $hamburger-layer-height / 2; +@if index($hamburger-types, slider-r) { + /* + * Slider Reverse + */ + .hamburger--slider-r { + .hamburger-inner { + top: $hamburger-layer-height / 2; - &::before { - top: $hamburger-layer-height + $hamburger-layer-spacing; - transition-property: transform, opacity; - transition-timing-function: ease; - transition-duration: 0.2s; - } + &::before { + top: $hamburger-layer-height + $hamburger-layer-spacing; + transition-property: transform, opacity; + transition-timing-function: ease; + transition-duration: 0.2s; + } - &::after { - top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2); + &::after { + top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2); + } } - } - &.is-active { - .hamburger-inner { - $y-offset: $hamburger-layer-spacing + $hamburger-layer-height; + &.is-active { + .hamburger-inner { + $y-offset: $hamburger-layer-spacing + $hamburger-layer-height; - transform: translate3d(0, $y-offset, 0) rotate(-45deg); + transform: translate3d(0, $y-offset, 0) rotate(-45deg); - &::before { - transform: rotate(45deg) translate3d($hamburger-layer-width / 7, $hamburger-layer-spacing * -1, 0); - opacity: 0; - } + &::before { + transform: rotate(45deg) translate3d($hamburger-layer-width / 7, $hamburger-layer-spacing * -1, 0); + opacity: 0; + } - &::after { - transform: translate3d(0, $y-offset * -2, 0) rotate(90deg); + &::after { + transform: translate3d(0, $y-offset * -2, 0) rotate(90deg); + } } } } diff --git a/_sass/hamburgers/types/_slider.scss b/_sass/hamburgers/types/_slider.scss index 872f9fe..78316d3 100644 --- a/_sass/hamburgers/types/_slider.scss +++ b/_sass/hamburgers/types/_slider.scss @@ -1,35 +1,37 @@ -/* - * Slider - */ -.hamburger--slider { - .hamburger-inner { - top: $hamburger-layer-height / 2; +@if index($hamburger-types, slider) { + /* + * Slider + */ + .hamburger--slider { + .hamburger-inner { + top: $hamburger-layer-height / 2; - &::before { - top: $hamburger-layer-height + $hamburger-layer-spacing; - transition-property: transform, opacity; - transition-timing-function: ease; - transition-duration: 0.2s; - } + &::before { + top: $hamburger-layer-height + $hamburger-layer-spacing; + transition-property: transform, opacity; + transition-timing-function: ease; + transition-duration: 0.2s; + } - &::after { - top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2); + &::after { + top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2); + } } - } - &.is-active { - .hamburger-inner { - $y-offset: $hamburger-layer-spacing + $hamburger-layer-height; + &.is-active { + .hamburger-inner { + $y-offset: $hamburger-layer-spacing + $hamburger-layer-height; - transform: translate3d(0, $y-offset, 0) rotate(45deg); + transform: translate3d(0, $y-offset, 0) rotate(45deg); - &::before { - transform: rotate(-45deg) translate3d($hamburger-layer-width / -7, $hamburger-layer-spacing * -1, 0); - opacity: 0; - } + &::before { + transform: rotate(-45deg) translate3d($hamburger-layer-width / -7, $hamburger-layer-spacing * -1, 0); + opacity: 0; + } - &::after { - transform: translate3d(0, $y-offset * -2, 0) rotate(-90deg); + &::after { + transform: translate3d(0, $y-offset * -2, 0) rotate(-90deg); + } } } } diff --git a/_sass/hamburgers/types/_spin-r.scss b/_sass/hamburgers/types/_spin-r.scss index 895c7b8..e07bd99 100644 --- a/_sass/hamburgers/types/_spin-r.scss +++ b/_sass/hamburgers/types/_spin-r.scss @@ -1,40 +1,42 @@ -/* - * Spin Reverse - */ -.hamburger--spin-r { - .hamburger-inner { - transition-duration: 0.3s; - transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); - - &::before { - transition: top 0.1s 0.34s ease-in, - opacity 0.1s ease-in; - } - - &::after { - transition: bottom 0.1s 0.34s ease-in, - transform 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19); - } - } - - &.is-active { +@if index($hamburger-types, spin-r) { + /* + * Spin Reverse + */ + .hamburger--spin-r { .hamburger-inner { - transform: rotate(-225deg); - transition-delay: 0.14s; - transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + transition-duration: 0.3s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); &::before { - top: 0; - opacity: 0; - transition: top 0.1s ease-out, - opacity 0.1s 0.14s ease-out; + transition: top 0.1s 0.34s ease-in, + opacity 0.1s ease-in; } &::after { - bottom: 0; - transform: rotate(-90deg); - transition: bottom 0.1s ease-out, - transform 0.3s 0.14s cubic-bezier(0.215, 0.61, 0.355, 1); + transition: bottom 0.1s 0.34s ease-in, + transform 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + } + + &.is-active { + .hamburger-inner { + transform: rotate(-225deg); + transition-delay: 0.14s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + + &::before { + top: 0; + opacity: 0; + transition: top 0.1s ease-out, + opacity 0.1s 0.14s ease-out; + } + + &::after { + bottom: 0; + transform: rotate(-90deg); + transition: bottom 0.1s ease-out, + transform 0.3s 0.14s cubic-bezier(0.215, 0.61, 0.355, 1); + } } } } diff --git a/_sass/hamburgers/types/_spin.scss b/_sass/hamburgers/types/_spin.scss index 0243c93..f730e7f 100644 --- a/_sass/hamburgers/types/_spin.scss +++ b/_sass/hamburgers/types/_spin.scss @@ -1,40 +1,42 @@ -/* - * Spin - */ -.hamburger--spin { - .hamburger-inner { - transition-duration: 0.3s; - transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); - - &::before { - transition: top 0.1s 0.34s ease-in, - opacity 0.1s ease-in; - } - - &::after { - transition: bottom 0.1s 0.34s ease-in, - transform 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19); - } - } - - &.is-active { +@if index($hamburger-types, spin) { + /* + * Spin + */ + .hamburger--spin { .hamburger-inner { - transform: rotate(225deg); - transition-delay: 0.14s; - transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + transition-duration: 0.3s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); &::before { - top: 0; - opacity: 0; - transition: top 0.1s ease-out, - opacity 0.1s 0.14s ease-out; + transition: top 0.1s 0.34s ease-in, + opacity 0.1s ease-in; } &::after { - bottom: 0; - transform: rotate(-90deg); - transition: bottom 0.1s ease-out, - transform 0.3s 0.14s cubic-bezier(0.215, 0.61, 0.355, 1); + transition: bottom 0.1s 0.34s ease-in, + transform 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + } + + &.is-active { + .hamburger-inner { + transform: rotate(225deg); + transition-delay: 0.14s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + + &::before { + top: 0; + opacity: 0; + transition: top 0.1s ease-out, + opacity 0.1s 0.14s ease-out; + } + + &::after { + bottom: 0; + transform: rotate(-90deg); + transition: bottom 0.1s ease-out, + transform 0.3s 0.14s cubic-bezier(0.215, 0.61, 0.355, 1); + } } } } diff --git a/_sass/hamburgers/types/_spring-r.scss b/_sass/hamburgers/types/_spring-r.scss index b4db11f..1189420 100644 --- a/_sass/hamburgers/types/_spring-r.scss +++ b/_sass/hamburgers/types/_spring-r.scss @@ -1,44 +1,46 @@ -/* - * Spring Reverse - */ -.hamburger--spring-r { - .hamburger-inner { - top: auto; - bottom: 0; - transition-duration: 0.15s; - transition-delay: 0s; - transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); - - &::after { - top: ($hamburger-layer-spacing * 2 + $hamburger-layer-height * 2) * -1; - transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), - opacity 0s linear; - } - - &::before { - transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), - transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); - } - } - - &.is-active { +@if index($hamburger-types, spring-r) { + /* + * Spring Reverse + */ + .hamburger--spring-r { .hamburger-inner { - transform: translate3d(0, ($hamburger-layer-spacing + $hamburger-layer-height) * -1, 0) rotate(-45deg); - transition-delay: 0.32s; - transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + top: auto; + bottom: 0; + transition-duration: 0.15s; + transition-delay: 0s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); &::after { - top: 0; - opacity: 0; - transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), - opacity 0s 0.32s linear; + top: ($hamburger-layer-spacing * 2 + $hamburger-layer-height * 2) * -1; + transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), + opacity 0s linear; } &::before { - top: 0; - transform: rotate(90deg); - transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), - transform 0.15s 0.32s cubic-bezier(0.215, 0.61, 0.355, 1); + transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), + transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + } + + &.is-active { + .hamburger-inner { + transform: translate3d(0, ($hamburger-layer-spacing + $hamburger-layer-height) * -1, 0) rotate(-45deg); + transition-delay: 0.32s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + + &::after { + top: 0; + opacity: 0; + transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), + opacity 0s 0.32s linear; + } + + &::before { + top: 0; + transform: rotate(90deg); + transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), + transform 0.15s 0.32s cubic-bezier(0.215, 0.61, 0.355, 1); + } } } } diff --git a/_sass/hamburgers/types/_spring.scss b/_sass/hamburgers/types/_spring.scss index b43d8ee..3dbd068 100644 --- a/_sass/hamburgers/types/_spring.scss +++ b/_sass/hamburgers/types/_spring.scss @@ -1,41 +1,43 @@ -/* - * Spring - */ -.hamburger--spring { - .hamburger-inner { - top: $hamburger-layer-height / 2; - transition: background-color 0s 0.15s linear; - - &::before { - top: $hamburger-layer-height + $hamburger-layer-spacing; - transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), - transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); - } - - &::after { - top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2); - transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), - transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); - } - } - - &.is-active { +@if index($hamburger-types, spring) { + /* + * Spring + */ + .hamburger--spring { .hamburger-inner { - transition-delay: 0.32s; - background-color: transparent; + top: $hamburger-layer-height / 2; + transition: background-color 0s 0.15s linear; &::before { - top: 0; - transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), - transform 0.15s 0.32s cubic-bezier(0.215, 0.61, 0.355, 1); - transform: translate3d(0, $hamburger-layer-spacing + $hamburger-layer-height, 0) rotate(45deg); + top: $hamburger-layer-height + $hamburger-layer-spacing; + transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), + transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); } &::after { - top: 0; - transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), - transform 0.15s 0.32s cubic-bezier(0.215, 0.61, 0.355, 1); - transform: translate3d(0, $hamburger-layer-spacing + $hamburger-layer-height, 0) rotate(-45deg); + top: ($hamburger-layer-height * 2) + ($hamburger-layer-spacing * 2); + transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), + transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + } + + &.is-active { + .hamburger-inner { + transition-delay: 0.32s; + background-color: transparent; + + &::before { + top: 0; + transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), + transform 0.15s 0.32s cubic-bezier(0.215, 0.61, 0.355, 1); + transform: translate3d(0, $hamburger-layer-spacing + $hamburger-layer-height, 0) rotate(45deg); + } + + &::after { + top: 0; + transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), + transform 0.15s 0.32s cubic-bezier(0.215, 0.61, 0.355, 1); + transform: translate3d(0, $hamburger-layer-spacing + $hamburger-layer-height, 0) rotate(-45deg); + } } } } diff --git a/_sass/hamburgers/types/_squeeze.scss b/_sass/hamburgers/types/_squeeze.scss index c40e6ec..4df9fb6 100644 --- a/_sass/hamburgers/types/_squeeze.scss +++ b/_sass/hamburgers/types/_squeeze.scss @@ -1,40 +1,42 @@ -/* - * Squeeze - */ -.hamburger--squeeze { - .hamburger-inner { - transition-duration: 0.1s; - transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); - - &::before { - transition: top 0.1s 0.14s ease, - opacity 0.1s ease; - } - - &::after { - transition: bottom 0.1s 0.14s ease, - transform 0.1s cubic-bezier(0.55, 0.055, 0.675, 0.19); - } - } - - &.is-active { +@if index($hamburger-types, squeeze) { + /* + * Squeeze + */ + .hamburger--squeeze { .hamburger-inner { - transform: rotate(45deg); - transition-delay: 0.14s; - transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + transition-duration: 0.1s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); &::before { - top: 0; - opacity: 0; - transition: top 0.1s ease, - opacity 0.1s 0.14s ease; + transition: top 0.1s 0.14s ease, + opacity 0.1s ease; } &::after { - bottom: 0; - transform: rotate(-90deg); - transition: bottom 0.1s ease, - transform 0.1s 0.14s cubic-bezier(0.215, 0.61, 0.355, 1); + transition: bottom 0.1s 0.14s ease, + transform 0.1s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + } + + &.is-active { + .hamburger-inner { + transform: rotate(45deg); + transition-delay: 0.14s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + + &::before { + top: 0; + opacity: 0; + transition: top 0.1s ease, + opacity 0.1s 0.14s ease; + } + + &::after { + bottom: 0; + transform: rotate(-90deg); + transition: bottom 0.1s ease, + transform 0.1s 0.14s cubic-bezier(0.215, 0.61, 0.355, 1); + } } } } diff --git a/_sass/hamburgers/types/_stand-r.scss b/_sass/hamburgers/types/_stand-r.scss index fd1caf7..b4e47ba 100644 --- a/_sass/hamburgers/types/_stand-r.scss +++ b/_sass/hamburgers/types/_stand-r.scss @@ -1,42 +1,44 @@ -/* - * Stand Reverse - */ -.hamburger--stand-r { - .hamburger-inner { - transition: transform 0.1s 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19), - background-color 0s 0.1s linear; +@if index($hamburger-types, stand-r) { + /* + * Stand Reverse + */ + .hamburger--stand-r { + .hamburger-inner { + transition: transform 0.1s 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19), + background-color 0s 0.1s linear; - &::before { - transition: top 0.1s 0.1s ease-in, - transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); - } + &::before { + transition: top 0.1s 0.1s ease-in, + transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } - &::after { - transition: bottom 0.1s 0.1s ease-in, - transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); + &::after { + transition: bottom 0.1s 0.1s ease-in, + transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } } - } - &.is-active { - .hamburger-inner { - transform: rotate(-90deg); - background-color: transparent; + &.is-active { + .hamburger-inner { + transform: rotate(-90deg); + background-color: transparent; - transition: transform 0.1s 0s cubic-bezier(0.215, 0.61, 0.355, 1), - background-color 0s 0.22s linear; + transition: transform 0.1s 0s cubic-bezier(0.215, 0.61, 0.355, 1), + background-color 0s 0.22s linear; - &::before { - top: 0; - transform: rotate(-45deg); - transition: top 0.1s 0.12s ease-out, - transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); - } + &::before { + top: 0; + transform: rotate(-45deg); + transition: top 0.1s 0.12s ease-out, + transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); + } - &::after { - bottom: 0; - transform: rotate(45deg); - transition: bottom 0.1s 0.12s ease-out, - transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); + &::after { + bottom: 0; + transform: rotate(45deg); + transition: bottom 0.1s 0.12s ease-out, + transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); + } } } } diff --git a/_sass/hamburgers/types/_stand.scss b/_sass/hamburgers/types/_stand.scss index dbec46f..67c05a9 100644 --- a/_sass/hamburgers/types/_stand.scss +++ b/_sass/hamburgers/types/_stand.scss @@ -1,42 +1,44 @@ -/* - * Stand - */ -.hamburger--stand { - .hamburger-inner { - transition: transform 0.1s 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19), - background-color 0s 0.1s linear; +@if index($hamburger-types, stand) { + /* + * Stand + */ + .hamburger--stand { + .hamburger-inner { + transition: transform 0.1s 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19), + background-color 0s 0.1s linear; - &::before { - transition: top 0.1s 0.1s ease-in, - transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); - } + &::before { + transition: top 0.1s 0.1s ease-in, + transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } - &::after { - transition: bottom 0.1s 0.1s ease-in, - transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); + &::after { + transition: bottom 0.1s 0.1s ease-in, + transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); + } } - } - &.is-active { - .hamburger-inner { - transform: rotate(90deg); - background-color: transparent; + &.is-active { + .hamburger-inner { + transform: rotate(90deg); + background-color: transparent; - transition: transform 0.1s 0s cubic-bezier(0.215, 0.61, 0.355, 1), - background-color 0s 0.22s linear; + transition: transform 0.1s 0s cubic-bezier(0.215, 0.61, 0.355, 1), + background-color 0s 0.22s linear; - &::before { - top: 0; - transform: rotate(-45deg); - transition: top 0.1s 0.12s ease-out, - transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); - } + &::before { + top: 0; + transform: rotate(-45deg); + transition: top 0.1s 0.12s ease-out, + transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); + } - &::after { - bottom: 0; - transform: rotate(45deg); - transition: bottom 0.1s 0.12s ease-out, - transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); + &::after { + bottom: 0; + transform: rotate(45deg); + transition: bottom 0.1s 0.12s ease-out, + transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); + } } } } diff --git a/_sass/hamburgers/types/_vortex-r.scss b/_sass/hamburgers/types/_vortex-r.scss index fd7b300..37a6539 100644 --- a/_sass/hamburgers/types/_vortex-r.scss +++ b/_sass/hamburgers/types/_vortex-r.scss @@ -1,45 +1,47 @@ -/* - * Vortex Reverse - */ -.hamburger--vortex-r { - .hamburger-inner { - transition-duration: 0.3s; - transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); - - &::before, - &::after { - transition-duration: 0s; - transition-delay: 0.1s; - transition-timing-function: linear; - } - - &::before { - transition-property: top, opacity; - } - - &::after { - transition-property: bottom, transform; - } - } - - &.is-active { +@if index($hamburger-types, vortex-r) { + /* + * Vortex Reverse + */ + .hamburger--vortex-r { .hamburger-inner { - transform: rotate(-765deg); + transition-duration: 0.3s; transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); &::before, &::after { - transition-delay: 0s; + transition-duration: 0s; + transition-delay: 0.1s; + transition-timing-function: linear; } &::before { - top: 0; - opacity: 0; + transition-property: top, opacity; } &::after { - bottom: 0; - transform: rotate(-90deg); + transition-property: bottom, transform; + } + } + + &.is-active { + .hamburger-inner { + transform: rotate(-765deg); + transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); + + &::before, + &::after { + transition-delay: 0s; + } + + &::before { + top: 0; + opacity: 0; + } + + &::after { + bottom: 0; + transform: rotate(-90deg); + } } } } diff --git a/_sass/hamburgers/types/_vortex.scss b/_sass/hamburgers/types/_vortex.scss index 503a011..75a5128 100644 --- a/_sass/hamburgers/types/_vortex.scss +++ b/_sass/hamburgers/types/_vortex.scss @@ -1,45 +1,47 @@ -/* - * Vortex - */ -.hamburger--vortex { - .hamburger-inner { - transition-duration: 0.3s; - transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); - - &::before, - &::after { - transition-duration: 0s; - transition-delay: 0.1s; - transition-timing-function: linear; - } - - &::before { - transition-property: top, opacity; - } - - &::after { - transition-property: bottom, transform; - } - } - - &.is-active { +@if index($hamburger-types, vortex) { + /* + * Vortex + */ + .hamburger--vortex { .hamburger-inner { - transform: rotate(765deg); + transition-duration: 0.3s; transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); &::before, &::after { - transition-delay: 0s; + transition-duration: 0s; + transition-delay: 0.1s; + transition-timing-function: linear; } &::before { - top: 0; - opacity: 0; + transition-property: top, opacity; } &::after { - bottom: 0; - transform: rotate(90deg); + transition-property: bottom, transform; + } + } + + &.is-active { + .hamburger-inner { + transform: rotate(765deg); + transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); + + &::before, + &::after { + transition-delay: 0s; + } + + &::before { + top: 0; + opacity: 0; + } + + &::after { + bottom: 0; + transform: rotate(90deg); + } } } } diff --git a/bower.json b/bower.json index ee72a1b..3153013 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "css-hamburgers", - "version": "0.4.0", + "version": "0.5.0", "description": "Collection of tasty CSS-animated hamburger icons. Includes Sass files (modular and customizable), so cook up your own hamburger.", "license": "MIT", "author": { diff --git a/package.json b/package.json index ff2acaf..21bbcf1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hamburgers", - "version": "0.4.0", + "version": "0.5.0", "description": "Collection of tasty CSS-animated hamburger icons. Includes Sass files (modular and customizable), so cook up your own hamburger.", "license": "MIT", "author": {