tofuness/Toshocat

View on GitHub
src/styles/components/UI/picker.scss

Summary

Maintainability
Test Coverage
.picker-btn {
    position: relative;
}
.picker-btn-text {
    @extend .button;
    min-width: 120px;
    text-align: center;
    &.added {
        color: #fff;
        background: $picker-btn-added;
        border: 2px solid $picker-btn-added;
        &.active {
            @extend .ts;
            color: $picker-btn-added;
            background: transparent!important;
        }
        &:hover:not(.active) {
            background: $picker-btn-added;
            border-color: $picker-btn-added;
        }
        &:active:not(.active) {
            transform: translateY(1px);
            background: $picker-btn-added;
            border-color: $picker-btn-added;
        }
    }
}
.picker-animate-success {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    color: #fff;
    font-size: 16px;
    background: $slime-green;
    text-align: center;
    border-radius: 40px;
    &>div {
        transform: translateY(30px);
    }
}
.picker-animate-remove {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    color: #fff;
    font-weight: bold;
    background: $cran-red;
    font-size: ms(0);
    text-align: center;
    text-transform: uppercase;
    border-radius: 40px;
    &>div {
        transform: translateY(30px);
    }
}
.picker-btn-content {
    position: absolute;
    top: -70px;
    left: -230px;
    background: #fff;
    z-index: 2;
    border-radius: 4px;
    box-shadow: 0 4px 16px transparentize(#000, 0.8);
    &.active {
        animation-name: slideLeftIn;
        animation-duration: 220ms;
        animation-timing-function: cubic-bezier(0, .33, .2, 1);
    }
    &:before, &:after {
        left: 100%;
        top: 50%;
        border: solid transparent;
        content: " ";
        height: 0;
        width: 0;
        position: absolute;
        pointer-events: none;
    }
    &:after {
        border-color: rgba(255, 255, 255, 0);
        border-left-color: #fff;
        border-width: 5px;
        margin-top: -5px;
    }
    &:before {
        border-color: rgba(220, 223, 228, 0);
        border-left-color: #dcdfe4;
        border-width: 6px;
        margin-top: -6px;
    }
    &.top {
        top: 0;
        &:before, &:after {
            top: 15px;
        }
    }
    &.bottom {
        top: auto;
        bottom: 0;
        &:before, &:after {
            top: 156px;
        }
    }
}
.picker-header {
    padding-bottom: 5px;
    font-size: ms(0);
    &:not(:first-child) {
        padding-top: 10px;
    }
}
.picker-section {
    float: left;
    &:not(:first-child) {
        padding-left: 10px;
    }
}
.picker-row {
    @extend .cf;
    padding: 10px 10px 0 10px;
    &:last-child {
        padding-bottom: 10px;
    }
}
.picker-counter {
    float: left;
}
.picker-counter-sep {
    float: left;
    padding-left: 8px;
    font-weight: 700;
    line-height: 29px;
    text-align: center;
}
.picker-counter-total {
    float: left;
    padding-left: 8px;
    font-weight: 700;
    line-height: 29px;
    text-align: center;
}
.picker-heart {
    color: $cran-red;
    font-size: 28px;
}
.picker-bottom {
    @extend .cf;
    margin-top: 10px;
    padding: 10px;
    border-top: 1px solid $border-on-white;
}
.picker-save {
    @extend .button;
    float: right;
}
.picker-remove {
    cursor: pointer;
    margin-right: 10px;
    float: right;
    color: $byline;
    font-size: ms(0);
    line-height: 29px;
    text-transform: uppercase;
    &:hover {
        color: $cran-red;
    }
    &:active {
        transform: translateY(1px);
    }
}