Skip to content

Commit

Permalink
Fix burger menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Wei committed Apr 16, 2016
1 parent ee6aea1 commit e103219
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minuet",
"version": "0.4.3",
"version": "0.4.4",
"description": "An experimental stylesheet library.",
"homepage": "http://VARIANTE.github.io/minuet",
"license": "MIT",
Expand Down
25 changes: 20 additions & 5 deletions src/sass/mixins/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
@include min-size($width $height);
@include size($width $height);
background: transparent;
position: relative;

@include state('hover') {
span:not(:only-of-type):nth-of-type(2) {
Expand All @@ -46,14 +45,30 @@

&:nth-of-type(1) {
transform: translate3d(#{$width / 2}, 0, 0);
&::before { transform: translate3d(#{$width / -2 + $thickness}, #{$height / 4}, 0) rotate(45deg); }
&::after { transform: translate3d(#{$width / -2 + $thickness}, #{$height / -4 + $thickness}, 0) rotate(-45deg); }

&::before {
@include size($width $thickness);
transform: translate3d(#{$width / -2 + $thickness}, #{$height / 4}, 0) rotate(45deg);
}

&::after {
@include size($width $thickness);
transform: translate3d(#{$width / -2 + $thickness}, #{$height / -4 + $thickness}, 0) rotate(-45deg);
}
}

&:nth-of-type(2) {
transform: translate3d(#{$width / -2}, 0, 0);
&::before { transform: translate3d(#{$thickness * -1}, #{$height / 4}, 0) rotate(-45deg); }
&::after { transform: translate3d(#{$thickness * -1}, #{$height / -4 + $thickness}, 0) rotate(45deg); }

&::before {
@include size($width $thickness);
transform: translate3d(#{$thickness * -1}, #{$height / 4}, 0) rotate(-45deg);
}

&::after {
@include size($width $thickness);
transform: translate3d(#{$thickness * -1}, #{$height / -4 + $thickness}, 0) rotate(45deg);
}
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/stylus/mixins/components.styl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ burger-button($width=27px, $height=20px, $thickness=2px, $color=#fff)
min-size($width $height)
size($width $height)
background: transparent
position: relative

+state('hover')
span:not(:only-of-type):nth-of-type(2)
Expand All @@ -29,7 +28,7 @@ burger-button($width=27px, $height=20px, $thickness=2px, $color=#fff)
&::after
size($width $thickness)

+state('hover')
+state('active')
span:only-of-type
size(0 $thickness)
&:nth-of-type(1)
Expand All @@ -49,15 +48,19 @@ burger-button($width=27px, $height=20px, $thickness=2px, $color=#fff)
&:nth-of-type(1)
transform: translate3d(($width / 2), 0, 0)
&::before
size($width $thickness)
transform: translate3d(($width / -2 + $thickness), ($height / 4), 0) rotate(45deg)
&::after
size($width $thickness)
transform: translate3d(($width / -2 + $thickness), ($height / -4 + $thickness), 0) rotate(-45deg)

&:nth-of-type(2)
transform: translate3d(($width / -2), 0, 0)
&::before
size($width $thickness)
transform: translate3d(($thickness * -1), ($height / 4), 0) rotate(-45deg)
&::after
size($width $thickness)
transform: translate3d(($thickness * -1), ($height / -4 + $thickness), 0) rotate(45deg)

span:only-of-type,
Expand Down

0 comments on commit e103219

Please sign in to comment.