$dark: #35414a; $semilight: #86919a; $blue: #5aafee; *, *:before, *:after { box-sizing: border-box; margin: 0; padding: 0; } @font-face { font-family: pfs-bold; src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/142996/PFSquareSansPro-Bold.otf'); } body { background: $dark; } .drop { width: 20em; margin: 5em auto; font-family: pfs-bold; color: $semilight; text-transform: uppercase; position: relative; transition: width 0.5s; will-change: width; .option { padding: 1em; cursor: pointer; background-color: #485761; &:not(.active) { display: none; opacity: 0; transform: translateY(-50%); } } &.visible { animation: bounce 1s; width: 24em; &:before, &:after { border-color: #fff; } &:before { opacity: 0; } &:after { opacity: 1; } .option { color: #fff; display: block; } } &.opacity { .option { transform: translateZ(0); opacity: 1; @for $i from 0 to 10 { &:nth-child(#{$i}) { transition: opacity 0.5s 0.1s*$i, transform 0.5s 0.1s*$i; } } } } &.withBG { .option { transition: background-color 0.1s; &:not(.placeholder):hover { background-color: $blue; } &:not(.placeholder).active { background-color: $blue; } } } &:after, &:before { content: ""; position: absolute; top: 1.5em; right: 1em; width: 0.75em; height: 0.75em; border: 0.2em solid $semilight; transform: rotate(45deg); transform-origin: 50% 50%; transition: opacity 0.2s; } &:before { border-left: none; border-top: none; top: 1.2em; } &:after { border-right: none; border-bottom: none; opacity: 0; } } .mini-hack { opacity: 0; transform: translateY(-50%); }