Skip to content

Instantly share code, notes, and snippets.

@jpwesselink
Created October 23, 2013 19:06
Show Gist options
  • Save jpwesselink/7124667 to your computer and use it in GitHub Desktop.
Save jpwesselink/7124667 to your computer and use it in GitHub Desktop.
Designmodo Flat-ui Select2 Less styles
.select2-container {
.form-control();
&.select2-container-multi {
background: white;
border: 2px solid mix(@inverse, @brand-primary, 90%);
border-radius: @border-radius-large;
margin-bottom: 18px;
padding: 6px 1px 1px 6px;
overflow-y: auto;
text-align: left;
}
&.select2-container-active {
border-color: @brand-secondary;
}
}
.select2-drop, .select2-drop.select2-drop-above {
background: transparent;
border: 0;
border-radius: 0;
.box-shadow(none);
}
.select2-drop.select2-drop-above {
padding-bottom: 5px;
}
.select2-results {
// reset this
max-height: none;
padding: 0;
margin: 0;
position: relative;
overflow-x: visible;
overflow-y: visible;
.select2-no-results {
background: transparent;
padding-left: 4px;
padding-right: 4px;
}
// new styles
opacity: 1;
visibility: visible;
width: auto;
margin-top: 5px;
border: 2px solid @brand-secondary;
padding: 5px 0;
background-color: @inverse;
border-radius: @border-radius-large;
li {
.select2-result-label {
background: #1abc9c;
color: #ffffff;
}
a {
padding: 6px 14px;
}
&:first-child,
&:last-child {
a {
padding: 6px 14px;
border-radius: 0;
}
}
}
}
.select2-choices {
.select2-search-choice {
border-radius: @border-radius-base;
background-color: mix(@inverse, @brand-primary, 90%);
color: mix(@brand-primary, @inverse, 65%);
font-size: ceil(@component-font-size-base * 0.933); // ~14px
cursor: pointer;
display: inline-block;
margin-right: 5px;
margin-bottom: 5px;
overflow: hidden;
line-height: 15px;
padding: 6px 13px 8px 13px;
position: relative;
vertical-align: middle;
.transition(.25s linear);
&:hover {
background-color: mix(@brand-secondary, black, 85%);
color: @inverse;
padding-left: 12px;
padding-right: 22px;
.select2-search-choice-close {
color: @inverse;
opacity: 1;
// Opacity fallback for IE
display: block\9;
}
}
}
input {
background: transparent;
border: none;
color: @brand-primary;
font-family: @font-family-base;
font-size: ceil(@component-font-size-base * 0.933); // ~14px
margin: 0px;
padding: 0 0 0 5px;
outline: none !important;
margin: 6px 5px 0 0;
vertical-align: top;
width: 12px;
}
}
.select2-search-choice-close {
bottom: 0;
color: @inverse;
cursor: pointer;
font-size: 12px;
opacity: 0;
padding: 7px 7px 5px 0;
position: absolute;
right: 0;
text-align: right;
text-decoration: none;
top: 0;
width: 100%;
z-index: 2;
// Opacity fallback for IE
display: none\9;
&:before {
color: @inverse;
content: "\e00b";
font-family: "Flat-UI-Icons";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment