getlackey/lackey-cms

View on GitHub
modules/cms/client/scss/table.scss

Summary

Maintainability
Test Coverage
@import "_vars";
@import "_content-gallery";
@import "_partials/_content-filter";
@import "_partials/_table-header";

.table-wrapper {
    margin: 0 2rem;
    overflow-x: auto;
}

[data-lky-component="table"] {
    overflow-y: auto;

    h2 {
        padding: 0 0 0 2rem;
        margin: 0 2rem 0 0;
        text-transform: capitalize;
        align-self: center;
    }

    form > label {
        margin: 0px 2rem 15px;
        display: block;
        span {
            font-weight: bolder;
            padding: 0px 0px 5px;
            display: block;
        }
        input {
            display: block;
            width: 100%;
        }
        input[type="checkbox"] {
            display: inline-block;
            width: auto;
        }
    }

    input[type="search"], input[type="text"] {
        border: 1px solid $color-background-highlight;
        color: $color-light-gray;
        border-radius: 30px;
        padding: 8px 10px;
        width: 250px;
    }

    .overflow-wrap {
        position: relative;
    }

    .overflow {
        margin: 0 2rem 0 0;
        width: 2rem;
        text-align: center;
        display: block;
        cursor: pointer;
    }

    .overflow-menu {
        visibility: hidden;
        opacity: 0;
        position: absolute;
        top: 2.4rem ;
        right: 2.5rem;
        background: #ffffff;
        z-index: 1;
        padding: 0.5rem 0;
        width: 10rem;
        box-shadow: 0 7px 8px -4px rgba(0,0,0,0.2), 0 13px 19px 2px rgba(0,0,0,0.14), 0 5px 24px 4px rgba(0,0,0,0.12);

        a {
            padding: 0.8rem 1.4rem;
            display: block;
            color: #454545;
            text-decoration: none;

            &:hover {
                background: #e8e8e8;
            }
        }

        &[data-visible] {
            visibility: visible;
            opacity: 1;
            transition-delay:0s;
        }
    }


    .profile-photo {
        display: flex;
        justify-content: space-between;
        align-items: stretch;
        padding: 10px 40px 40px;
        .upload {
            flex: 1 1 auto;

            [data-dropzone] {
                border: 5px dashed #c8c8c8;
                padding: 3.2rem;
                text-align: center;
                margin-top: 0.5rem;
                margin-right: 3rem;
                width: 100%;

                &.hover {
                    border-color: $color-background-highlight;
                    background-color: #f1f1f1;
                }

                span {
                    display: block;
                    margin-bottom: 2rem;
                    font-size: 1.5rem;
                    color: #6c6c6c;
                }

                button {
                    flex: 0 1 20%;
                    appearance: none;
                    background: $color-background-highlight;
                    border: 0;
                    padding: 0.5rem 1rem;
                    color: #ffffff;
                    font-size: 0.8rem;
                }
            }
        }

        .preview {
            flex: 0 0 auto;

            figure {
                border: 1px solid #c8c8c8;
                text-align: center;
                padding: 3rem;
                margin-top: 0.5rem;
                img {
                    width: 110px;
                    display: inline-block;
                }
            }
        }
    }


    // TABLE STYLES //

    table {
        transition: opacity $speed;
        border-spacing: 0px;
        border-collapse: collapse;
        width: 100%;
        table-layout: fixed;
        font-size: $table-font-size;
        margin: 20px auto;

        td,
        th {
            border: none;
            text-align: left;
            > img {
                height: auto;
                width: 100px;
                box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
            }
            a,
            button {
                display: inline-block;
                background: transparent;
                margin-left: 5px;
            }
            &[data-direction="desc"] {
                &:after {
                    font-family: 'sans-serif';
                    content: "\2193";
                    margin-left: 15px;
                }
            }
            &[data-direction="asc"] {
                &:after {
                    font-family: 'sans-serif';
                    content: "\2191";
                    margin-left: 15px;
                }
            }
        }

        td {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;

            button {
                border: none;
            }

            &.pagination {
                color: #6c6c6c;
                text-align: right;
                select {
                    width: 3rem;
                    appearance: none;
                    height: 1.6rem;
                    border-radius: 1px;
                    border: none;
                    padding: 0.2rem 0.5rem;
                    color: #555454;
                    background-image: url(../../../img/cms/cms/blocks/select-arrow.png);
                    background-color: #ffffff;
                    background-repeat: no-repeat;
                    background-position: center right;
                }

                a {
                    font-size: 24px;
                    text-decoration: none;
                    color: #6c6c6c
                }
            }
        }

        th.actions {
            width: 150px;
        }

        th {
            padding: 10px 15px 8px;
            color: #6c6c6c;
            font-weight: normal;
            text-transform: capitalize;
        }

        td {
            padding: 10px 15px 8px;
            color: #6c6c6c;
            font-weight: normal;
        }

        > tbody {
            > tr:nth-child(even) {
                background-color: $color-lighter-yet-gray;
            }
            > tr {
                border-bottom: 1px solid #e1e1e1;
            }
            tr:hover {
                background-color: $color-lackey-lighter-blue;
                cursor: pointer;
            }
        }
        > tfoot {
            text-align: left;
            td {
                padding-top: 20px;
                text-align: left;
            }
            ul {
                list-style: none;
                li {
                    display: inline-block;
                    margin-left: 30px;
                    vertical-align: middle;
                    a {
                        img {
                            width: 30px;
                        }
                    }
                    &[data-lky-active] {
                        a {
                            background: #00CBFE;
                            color: #FAFBFC;
                        }
                    }
                }
                li:last-child {
                    a {
                        margin-right: 0px;
                    }
                }
            }

            $green: $color-lackey-blue;
            $blue: $color-lackey-blue;
            $red: $color-lackey-blue;
            $yellow: $color-lackey-blue;
            $white: #ffffff;

            // scaling... any units
            $width: 30px;
            .loader {
                position: relative;
                margin: 0 auto;
                width: $width;
                &:before {
                    content: '';
                    display: block;
                    padding-top: 100%;
                }
            }
            .circular {
                animation: rotate 2s linear infinite;
                height: 100%;
                transform-origin: center center;
                width: 100%;
                position: absolute;
                top: 0;
                bottom: 0;
                left: 0;
                right: 0;
                margin: auto;
            }
            .path {
                stroke-dasharray: 1, 200;
                stroke-dashoffset: 0;
                animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite;
                stroke-linecap: round;
            }
            @keyframes rotate {
                100% {
                    transform: rotate(360deg);
                }
            }
            @keyframes dash {
                0% {
                    stroke-dasharray: 1, 200;
                    stroke-dashoffset: 0;
                }
                50% {
                    stroke-dasharray: 89, 200;
                    stroke-dashoffset: -35px;
                }
                100% {
                    stroke-dasharray: 89, 200;
                    stroke-dashoffset: -124px;
                }
            }
            @keyframes color {
                100%,
                0% {
                    stroke: $red;
                }
                40% {
                    stroke: $blue;
                }
                66% {
                    stroke: $green;
                }
                80%,
                90% {
                    stroke: $yellow;
                }
            }
        }
    }
}

[data-lky-component="profile"] {
    >form {
        > label {
            display: block;
            > input,
            > textarea,
            > select,
            > ul {
                display: block;
            }
        }
    }
    input,
    textarea,
    select {
        width: 100%;
        padding: 10px;
        font-size: 12px;
        margin: 10px 5px;
        border-radius: 3px;
        border: 1px solid #aaa;
    }
    pre > {
        width: 100%;
    }
    label {
        > div {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            justify-content: flex-start;
            align-content: stretch;
            align-items: stretch;
            > input {
                order: 0;
                flex: 1 1 auto;
                align-self: auto;
            }
            > button {
                order: 0;
                flex: 0 1 auto;
                align-self: auto;
                border: 1px solid $color-lackey-light-blue;
                background-color: $color-lackey-light-blue;
                color: white;
                padding: 5px 10px;
                margin-right: 5px;
            }
        }
    }
    .badges {
        list-style: none;
        padding: 0px;

        > li {
            display: inline-block;
            background: $color-background-highlight;
            border: 0;
            color: #ffffff;
            padding: 0.2rem 0.5rem;
            margin: 0 0 0.5rem 0.5rem;
            cursor: pointer;
            font-size: 0.6rem;

            &:first-of-type {margin-left: 0;}

            &:focus { outline:0; }

            &::after {
                font-family: Arial;
                content: "×";
                font-weight: bold;
                font-size: 0.8rem;
                margin-left: 1rem;
            }

            &.disabled {
                background-color: $color-washed;
                border-color: $color-washed;
            }

            &.action {
                background-color: #ffffff;
                border: 1px solid $color-lackey-light-blue;
                color: $color-lackey-light-blue;
                cursor: pointer;

                 &::after {
                    content: "";
                    margin:0;
                }
            }

//            > a {
//                margin-left: 5px;
//                cursor: pointer;
//            }
        }
    }

    table {
        border-spacing: 0px;
        border-collapse: collapse;
        width: 100%;
        font-size: $table-font-size;
        > thead {
            background-color: $color-background-highlight;
            color: #ffffff;
        }
        td,
        th {
            border: none;
            text-align: left;
            a,
            button {
                display: inline-block;
                background: transparent;
                margin-left: 5px;
            }
        }
        td {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            button {
                border: none;
            }
            &:nth-child(odd) {
                background-color: lighten($color-background-highlight, 45%);
            }
        }
        th {
            padding: 25px 8px 20px;
            font-weight: normal;
            text-transform: capitalize;
        }
        td {
            padding: 10px 8px 8px;
            color: $color-washed;
        }
        > tbody {
            > tr:nth-child(even) {
                background-color: $color-lightest-gray;
                td,
                th {
                    &:nth-child(odd) {
                        background-color: lighten($color-lightest-gray, 30%);
                    }
                }
            }
        }
    }
}