You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thank you for some really beautiful hamburgers! I made it work without Javascript:
I am using the squeeze variant in a hamburger menu which, instead of the proposed a tag, uses a label tag with associated hidden checkbox and :checked pseudo selector.
I replaced the &.is-active selector from the _base.scss and the _squeeze.scss file with a Sass variable $hamburger-activeClass and made it configurable like your other setting variables, and set its default to the original &.is-active value.
.toggleMenu {
Nav
{
display: none;
}
.hiddenToggle
{ // don't hide so it is still accessible
position: absolute;
left: -9999px;
}
.hiddenToggle:checked ~ nav
{
display: block;
}
}
For above use case, I set the $hamburger-activeClass variable to .hiddenToggle:checked ~ & and it works like a charm.
If you think this would be a good overall function for hamburgers, let me know and I'll prepare a pull request with all hamburger variants adjusted with the new variable.
Regards, Mikael
The text was updated successfully, but these errors were encountered:
Jonathan,
thank you for some really beautiful hamburgers! I made it work without Javascript:
I am using the squeeze variant in a hamburger menu which, instead of the proposed
a
tag, uses alabel
tag with associated hidden checkbox and :checked pseudo selector.I replaced the
&.is-active
selector from the_base.scss
and the_squeeze.scss
file with a Sass variable$hamburger-activeClass
and made it configurable like your other setting variables, and set its default to the original&.is-active
value.Here is my html:
The scss is:
For above use case, I set the
$hamburger-activeClass
variable to.hiddenToggle:checked ~ &
and it works like a charm.If you think this would be a good overall function for hamburgers, let me know and I'll prepare a pull request with all hamburger variants adjusted with the new variable.
Regards, Mikael
The text was updated successfully, but these errors were encountered: