body { background: #4285f4; color: #fff; font-family: "Open Sans", sans-serif; padding: 30px; text-align: center; } .checkbox { position: absolute; visibility: hidden; &__label { cursor: pointer; display: inline-block; position: relative; text-align: center; width: 50px; } } .pin { background: #5892fc; border-radius: 100%; box-shadow: 0 1px 3px rgba(#000, 0.1), 0 5px 5px rgba(#000, 0.1); display: block; height: 25px; position: absolute; left: -4px; top: -4px; transition: background 0.25s, left 0.25s, box-shadow 0.25s; width: 25px; .checkbox__label:hover & { box-shadow: 0 1px 3px rgba(#000, 0.1), 0 5px 5px rgba(#000, 0.1), 0 10px 15px rgba(#000, 0.2); } &__track { background: #3262ba; border-radius: 9px; content: ' '; display: block; height: 17px; transition: background 0.25s; width: 100%; .checkbox:checked + & { background: #d9e7ff; .pin { background: #fafafa; left: 29px; &__component { &__wrapper { left: 52%; transform: translateX(-50%) translateY(-50%) rotate(0deg); } &--top { background: #377df9; &:before { border-bottom: 2px solid #377df9; } &:after { border-top: 2px solid #377df9; } } &--bottom { border-top: 6px solid #377df9; } } } } } &__component { transition: background 0.25s, border 0.25s; &__wrapper { left: 50%; position: absolute; top: 50%; transition: transform 0.25s; transform: translateX(-50%) translateY(-50%) rotate(45deg); } &--top { background: #fff; display: block; height: 4px; position: relative; width: 6px; &:before, &:after { content: ' '; display: block; position: absolute; transition: border 0.25s; width: 100% } &:before { border-bottom: 2px solid #fff; border-left: 2px solid transparent; border-right: 2px solid transparent; border-top: none; bottom: -2px; left: -2px; } &:after { border-bottom: none; border-left: 1px solid transparent; border-right: 1px solid transparent; border-top: 2px solid #fff; left: -1px; top: -2px; width: 100%; } } &--bottom { border-bottom: none; border-left: 1px solid transparent; border-right: 1px solid transparent; border-top: 6px solid #fff; box-sizing: border-box; display: block; left: 50%; position: relative; top: 2px; transform: translateX(-50%); height: 0; width: 0; } } }