Files
flood/client/source/sass/components/_dropdown.scss
2016-01-23 19:50:28 -08:00

152 lines
2.3 KiB
SCSS

.dropdown {
display: inline-block;
outline: none;
position: relative;
z-index: 2;
&__button,
&__trigger {
cursor: pointer;
}
&__button {
display: block;
padding: 12px 15px 7px 15px;
text-align: left;
width: auto;
word-wrap: none;
}
&__content {
background: $dropdown--background;
border-radius: 3px;
box-shadow:
0 0 0 1px $dropdown--container--border,
0 0 35px $dropdown--container--shadow;
color: $dropdown--foreground;
left: 0;
position: absolute;
text-align: left;
top: 0;
z-index: 2;
}
&.is-expanded {
.dropdown {
&__header {
.dropdown {
&__value {
color: $dropdown--value--active;
}
}
}
}
}
&__label {
color: $dropdown--label;
display: block;
font-size: 0.65em;
font-weight: 500;
letter-spacing: 0.1em;
line-height: 0.9em;
text-transform: uppercase;
.dropdown__button & {
cursor: pointer;
}
}
&__value {
color: $dropdown--value;
transition: color 0.25s;
&:after {
border-top: 5px solid $dropdown--value;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
content: '';
display: inline-block;
margin-left: 10px;
vertical-align: middle;
}
}
&__header {
position: relative;
&:after {
background: $dropdown--header--border;
bottom: 0;
content: '';
display: block;
height: 1px;
left: 5%;
position: absolute;
width: 90%;
}
}
&__items {
display: flex;
padding: 10px 0;
}
&__list {
flex: 1;
}
&__item {
padding: 5px 15px;
&.is-selectable {
cursor: pointer;
display: block;
font-size: 0.9em;
transition: background 0.25s, color 0.25s;
&:hover {
background: $dropdown--item--background--hover;
color: $dropdown--item--foreground--hover;
}
&.is-selected {
color: $dropdown--item--foreground--active;
}
}
}
&--align-right & {
left: auto;
right: 0;
}
}
.dropdown {
&__content {
&-enter {
animation: fade-in 0.25s both;
}
&-leave {
animation: fade-out 0.25s both;
}
}
}
.dropdown {
&__content {
&__container {
padding: 25px 30px;
}
}
}