Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mobile variable support #1

Merged
merged 2 commits into from
Oct 19, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update _base.scss
  • Loading branch information
ntdb authored Oct 19, 2019
commit d58e77edb58b1689200a443e8fbe3a3415d1af0e
40 changes: 40 additions & 0 deletions _sass/hamburgers/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@
margin: 0;
overflow: visible;

@media (max-width: $hamburger-breakpoint-mobile) {
padding: $hamburger-padding-y-mobile $hamburger-padding-x-mobile;
}

&:hover {
@if $hamburger-hover-use-filter == true {
filter: $hamburger-hover-filter;
}
@else {
opacity: $hamburger-hover-opacity;

@media (max-width: $hamburger-breakpoint-mobile) {
opacity: $hamburger-hover-opacity-mobile;
}
}
}

Expand All @@ -34,13 +42,21 @@
}
@else {
opacity: $hamburger-active-hover-opacity;

@media (max-width: $hamburger-breakpoint-mobile) {
opacity: $hamburger-hover-opacity-mobile;
}
}
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
background-color: $hamburger-active-layer-color;

@media (max-width: $hamburger-breakpoint-mobile) {
background-color: $hamburger-active-layer-color-mobile;
}
}
}
}
Expand All @@ -50,13 +66,22 @@
height: $hamburger-layer-height * 3 + $hamburger-layer-spacing * 2;
display: inline-block;
position: relative;

@media (max-width: $hamburger-breakpoint-mobile) {
width: $hamburger-layer-width-mobile;
height: $hamburger-layer-height-mobile * 3 + $hamburger-layer-spacing-mobile * 2;
}
}

.hamburger-inner {
display: block;
top: 50%;
margin-top: $hamburger-layer-height / -2;

@media (max-width: $hamburger-breakpoint-mobile) {
margin-top: $hamburger-layer-height-mobile / -2;
}

&,
&::before,
&::after {
Expand All @@ -68,6 +93,13 @@
transition-property: transform;
transition-duration: 0.15s;
transition-timing-function: ease;

@media (max-width: $hamburger-breakpoint-mobile) {
width: $hamburger-layer-width-mobile;
height: $hamburger-layer-height-mobile;
background-color: $hamburger-layer-color-mobile;
border-radius: $hamburger-layer-border-radius-mobile;
}
}

&::before,
Expand All @@ -78,9 +110,17 @@

&::before {
top: ($hamburger-layer-spacing + $hamburger-layer-height) * -1;

@media (max-width: $hamburger-breakpoint-mobile) {
top: ($hamburger-layer-spacing-mobile + $hamburger-layer-height-mobile) * -1;
}
}

&::after {
bottom: ($hamburger-layer-spacing + $hamburger-layer-height) * -1;

@media (max-width: $hamburger-breakpoint-mobile) {
bottom: ($hamburger-layer-spacing-mobile + $hamburger-layer-height-mobile) * -1;
}
}
}