tofuness/Toshocat

View on GitHub
src/styles/components/list.scss

Summary

Maintainability
Test Coverage
.list {
    height: 100%;
}
.list-tabs {
    @extend .cf;
    background: $dover-gray;
}
.list-tab {
    cursor: pointer;
    float: left;
    padding: 10px 20px;
    height: 35px;
    color: $ongray-byline;
    font-weight: 700;
    &.active {
        color: $lapis-blue;
        background: #fff;
    }
    &:hover:not(.active) {
        background: mix(white, $dover-gray, 40%);
    }
}
.list-headers {
    @extend .cf;
    font-weight: 700;
    box-shadow: 0 1px 0 $border-on-white;
}
.list-headers-sortable {
    @extend .cf;
    padding-right: 10px;
    width: 100%;
    height: 35px;
}
.list-header {
    @extend .cf;
    @extend .ts;
    cursor: pointer;
    float: left;
    padding: 11px 0 9px 11px;
    width: 12%;
    color: $byline;
    background: #fff;
    border-right: 1px solid $border-on-white;
    &:last-child {
        border-right: 1px solid transparent;
    }
    &.active {
        color: $lapis-blue;
        //box-shadow: inset 0 -1px 0 $lapis-blue;
    }
    &.sortable-ghost {
        color: #fff;
        background: $border-on-white;
    }
}
.list-header--title {
    width: 64%;
}
.list-header-title {
    float: left;
}
.list-header-icon {
    @extend .ts;
    float: left;
    margin-left: 2px;
    height: 10px;
    font-size: 18px;
    transform: translateY(-2px);
    transform-origin: center 9px;
    &.asc {
        transform: rotateX(180deg) translateY(1px);
    }
}
.list-tab-count {
    margin-left: 5px;
    padding: 1px 4px;
    display: inline-block;
    color: $onblack-byline!important;
    font-size: ms(0);
    background: $dover-gray;
    border-radius: 2px;
    transform: translateY(-1px);
}
.list-search-input {
    padding: 10px;
    width: 100%;
    border: 0;
    outline: 0;
}
.list-reactlist {
    overflow-y: scroll;
    width: 100%;
    height: calc(100% - 35px - 37px); // - tabs height - headers height
}
.list-item-content {
    @extend .cf;
    &>div {
        height: 35px;
    }
}
.list-item {
    @extend .cf;
    border-bottom: 1px solid $border-on-white;
    transition: box-shadow, background 220ms cubic-bezier(0, .33, .2, 1);
    &:hover:not(.expanded) {
        background: $dover-gray;
    }
    &.expanded {
        box-shadow: 0 0 16px transparentize(#000, 0.9);
    }
    &.expanded .list-item-content>div {
        @extend .ts;
        border-right: 1px solid transparent;
    }
    &:not(.expanded) .list-item-content>div {
        @extend .ts;
        border-right: 1px solid $border-on-white;
        &:last-child {
            border-right: 1px solid transparent;
        }
    }
    &:last-child {
        margin-bottom: 20px;
    }
}
.list-item-title {
    float: left;
    overflow: hidden;
    padding: 10px;
    width: 64%;
}
.list-item-hasnotes {
    @extend .ts-out;
    visibility: hidden;
    display: inline-block;
    margin-left: 5px;
    padding: 2px 5px;
    opacity: 0;
    color: #fff;
    font-size: ms(0);
    background: $lapis-blue;
    border-radius: 4px;
    transform: translateY(-10px);
    &.visible {
        @extend .ts-slow;
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
    }
}
.list-item-link {
    cursor: pointer;
    display: inline-block;
    &:hover {
        box-shadow: 0 1px 0 $winter-black;
    }
}
.list-item-progress {
    @extend .cf;
    float: left;
    padding: 10px;
    width: 12%;
    font-weight: 700;
}
.list-item-increment {
    @extend .ts;
    margin-right: 10px;
    padding: 2px 4px;
    float: left;
    color: $body;
    font-size: 16px;
    font-weight: 700;
    line-height: 12px;
    background: $border-on-white;
    border-radius: 2px;
    &:hover {
        cursor: pointer;
        color: #fff;
        background: $lapis-blue;
    }
}
.list-item-rating {
    float: left;
    padding: 10px;
    width: 12%;
    font-weight: 700;
}
.list-item-rating-icon {
    display: inline-block;
    padding-right: 10px;
    color: $cran-red;
    transform: translateY(2px);
}
.list-item-type {
    float: left;
    padding: 10px;
    width: 12%;
    color: $byline;
    font-weight: 700;
    text-transform: uppercase;
}

.expansion {
    @extend .cf;
    padding: 10px;
}
.expansion-left {
    float: left;
    width: calc(64% - 10px);
}
.expansion-left textarea {
    line-height: 1.5;
    background: transparent;
}
.expansion-right {
    float: right;
    display: flex;
    flex-flow: column;
    align-items: flex-end;
}
.expansion-button {
    width: 120px;
}
.expansion-lastupdated {
    margin-top: 5px;
    color: $byline;
    font-size: ms(0);
    white-space: nowrap;
    text-align: left;
}

.list-empty {
    position: relative;
    height: calc(100% - 35px - 35px);
}
.list-empty-content {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -42px;
    margin-left: -166px;
    text-align: center;
}
.list-empty-title {
    font-size: ms(2);
}
.list-empty-message {
    padding: 10px 0;
    color: $body;
}
.list-empty-action {
    @extend .button;
    display: inline-block;
}