Skip to content

Instantly share code, notes, and snippets.

@oliverbenns
Created December 3, 2014 00:45
Show Gist options
  • Select an option

  • Save oliverbenns/a6fa8cb9fac80977edcf to your computer and use it in GitHub Desktop.

Select an option

Save oliverbenns/a6fa8cb9fac80977edcf to your computer and use it in GitHub Desktop.
Stylus Dropdown
/* ==========================================================================
Dropdown
========================================================================== */
.dropdown
border 1px solid $color-black
overflow hidden
background $color-white url("../img/arrow-select.png") no-repeat right 50%
width 100%
position relative
.dropdown__select
display block
font-weight 300
font-size 12px
font-family $font-default
border 0
padding 10px
box-shadow none
background transparent
background-image none
outline none
cursor pointer
appearance(none)
width 100%
&:focus
outline none
// Firefox hack to remove outline - http://stackoverflow.com/questions/3773430/remove-outline-from-select-box-in-ff/18853002#18853002
&:-moz-focusring
color transparent
text-shadow 0 0 0 $color-black
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)
.dropdown
background $color-white url("../img/arrow-select@2x.png") no-repeat right 50%
background-size(19px 5px)
// Firefox fix to hide select arrow (v30.0)
@-moz-document url-prefix()
.dropdown-select
width 110%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment