Skip to content

Instantly share code, notes, and snippets.

@cx0der
Last active October 28, 2018 09:26
Show Gist options
  • Save cx0der/3de5f6569c0d8e66679071dde21318b6 to your computer and use it in GitHub Desktop.
Save cx0der/3de5f6569c0d8e66679071dde21318b6 to your computer and use it in GitHub Desktop.
Base styling for vue select
<style lang="scss" scoped>
$background-color: #fff;
$border-color: #101010;
$border-inactive-color: #606060;
$border-radius: 5px;
$item-hover-color: #f5f5f5;
$item-selected-color: rgba(0, 0, 0, .25);
*,
*:before,
*:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.select__dropdown {
font-size: 16px;
outline: none;
position: relative;
text-align: left;
}
.select__dropdown--close {
&::after {
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid $border-color;
content: '';
height: 0;
position: absolute;
right: 8px;
top: 20px;
width: 0;
}
}
.select__dropdown--open {
&::after {
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid $border-color;
content: '';
height: 0;
position: absolute;
right: 8px;
top: 20px;
width: 0;
}
}
.select__value {
border: 1px solid $border-inactive-color;
border-radius: $border-radius;
display: block;
height: 48px;
outline: none;
padding: 16px;
&:focus {
border-color: $border-color;
}
}
.select__optionlist {
background-color: $background-color;
border: 1px solid $border-color;
border-radius: 0 0 $border-radius $border-radius;
list-style: none;
margin: 0;
max-height: 150px;
padding: 0;
padding-bottom: 8px;
padding-top: 8px;
position: relative;
top: -3px;
z-index: 2000;
}
.select__optionlist--close {
visibility: hidden;
}
.select__option {
height: 32px;
line-height: 2;
padding: 0 16px;
text-align: left;
vertical-align: middle;
&:hover {
background-color: $item-hover-color;
}
}
.select__option--selected {
background-color: $item-selected-color;
&:hover {
background-color: $item-selected-color;
}
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment