Skip to content

Instantly share code, notes, and snippets.

@triple-j
Created June 4, 2015 22:02
Show Gist options
  • Save triple-j/de9c28f676fef2d043d1 to your computer and use it in GitHub Desktop.
Save triple-j/de9c28f676fef2d043d1 to your computer and use it in GitHub Desktop.
Flyout Menu SCSS mixins
///
// Flyout Menu CSS (Don't modify below this line!!!)
//
//
// Use the following code to apply these styles:
//
// @include flyout-horizontal;
// -or-
// @include flyout-vertical;
//
///
//
// expected structure
//
// <div|nav> -- apply `flyout()` to this
// <ul>
// <li>
// <a|span>
// <ul>
// <li>
// <a|span>
// <ul>
// etc.
//
@mixin flyout() {
ul {
min-width: 100%;
list-style: none;
margin: 0px;
padding: 0px;
}
li {
position: relative;
}
li > a,
li > span {
display: block;
}
& > ul {
ul {
display: none;
}
li.item-active > ul,
li:hover > ul {
display: block;
}
}
}
@mixin flyout-horizontal($z_idx: 20) {
@include flyout();
display: block;
position: relative;
z-index: $z_idx;
& > ul {
& > li {
float: left;
}
ul {
position: absolute;
ul {
position: absolute;
top: 0px;
left: 100%;
}
}
}
}
@mixin flyout-vertical($z_idx: 10) {
@include flyout();
display: block;
position: relative;
z-index: $z_idx;
& > ul {
ul {
position: absolute;
top: 0px;
left: 100%;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment