Skip to content

Instantly share code, notes, and snippets.

@robertlyall
Created April 9, 2014 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertlyall/10256628 to your computer and use it in GitHub Desktop.
Save robertlyall/10256628 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
%ul.dropdown
%li.dropdown__item.dropdown__item--active
%a.dropdown__link{:href => '#'} Hello?
%ul.dropdown__menu
%li.dropdown__menu-item
%a.dropdown__menu-link{:href => '#'} Option 1
%li.dropdown__menu-item
%a.dropdown__menu-link{:href => '#'} Option 2
%li.dropdown__menu-item
%a.dropdown__menu-link{:href => '#'} Option 3
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
*
box-sizing: border-box
body
font-family: "Helvetica Neue"
a
text-decoration: none
.dropdown, .dropdown__menu
list-style: none
margin: 0
padding: 0
.dropdown__item
padding: 0.5rem 1.5rem
position: relative
text-align: center
width: 100px
.dropdown__item--active
.dropdown__menu
display: block
.dropdown__menu
border-radius: 4px
border: 1px solid #edeeee
display: none
left: 0
position: absolute
top: 100%
.dropdown__menu-item
border-bottom: 1px solid #edeeee
padding: 0.5rem 1.5rem
min-width: 7.5em
&:last-child
border: none
* {
box-sizing: border-box;
}
body {
font-family: "Helvetica Neue";
}
a {
text-decoration: none;
}
.dropdown, .dropdown__menu {
list-style: none;
margin: 0;
padding: 0;
}
.dropdown__item {
padding: 0.5rem 1.5rem;
position: relative;
text-align: center;
width: 100px;
}
.dropdown__item--active .dropdown__menu {
display: block;
}
.dropdown__menu {
border-radius: 4px;
border: 1px solid #edeeee;
display: none;
left: 0;
position: absolute;
top: 100%;
}
.dropdown__menu-item {
border-bottom: 1px solid #edeeee;
padding: 0.5rem 1.5rem;
min-width: 7.5em;
}
.dropdown__menu-item:last-child {
border: none;
}
<ul class='dropdown'>
<li class='dropdown__item dropdown__item--active'>
<a class='dropdown__link' href='#'>Hello?</a>
<ul class='dropdown__menu'>
<li class='dropdown__menu-item'>
<a class='dropdown__menu-link' href='#'>Option 1</a>
</li>
<li class='dropdown__menu-item'>
<a class='dropdown__menu-link' href='#'>Option 2</a>
</li>
<li class='dropdown__menu-item'>
<a class='dropdown__menu-link' href='#'>Option 3</a>
</li>
</ul>
</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment