MinnPost/object-sync-for-salesforce

View on GitHub
assets/sass/object-sync-for-salesforce-admin.scss

Summary

Maintainability
Test Coverage
// modules
@use "sass:math";

// variables
$box-shadow-less: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
$box-shadow-more: 0 1px 1px rgba(0, 0, 0, 0.04);
$border-color: #dcdcde;
$horizontal-space: 10px;
$success-color: #00a32a;
$vertical-space: 15px;
$active-color: #72aee6;

.settings_page_object-sync-salesforce-admin {

    .form-table {

        td {

            .checkbox {
                line-height: 1.3;
                margin-bottom: 9px;
            }
        }
    }

    // salesforce version list
    .sfwp-salesforce-version-list {

        > tbody > tr.current,
        > tbody > tr.current td {
            background: $active-color;
            color: #fff;
        }
    }

    // fieldmap form
    .fieldmap {

        .spinner {
            display: inline-block;
            float: none;
        }

        fieldset {
            border: 1px solid $border-color;
            margin-bottom: $vertical-space;
            position: relative;
        }

        .fields {
            border: 0;
        }

        legend {
            margin-top: $vertical-space;
            padding-left: 12px;
            position: absolute;
        }

        .fields > :nth-child(2) {
            padding-top: 35px;
        }

        .fields .fieldmap-template {
            display: none;
        }

        .fieldmap_settings > :nth-child(2) {
            padding-top: 45px;
        }

        div {
            padding: $vertical-space $horizontal-space;

            label {
                display: inline-block;
                font-weight: 700;
                margin-bottom: math.div($vertical-space, 2);
            }

            input,
            select {
                display: block;
            }

            &.fieldmap_status {

                select {
                    display: inline-block;
                }
            }

        }

        .radios label,
        .checkboxes label {
            display: block;
            font-weight: 400;
        }

        .radios input,
        .checkboxes input {
            display: inline-block;
        }

        table {

            .column-direction {
                min-width: 200px;
            }

            td div {
                padding-left: 0;
                padding-top: 0;
            }
        }
    }

    // error table
    form.error-rows {

        .tablenav-pages-mappingerrors {
            // from the button on the left, use the same styles
            margin: 2px 0 0.8em;
            padding-top: 10px;
            text-align: right;

            .displaying-num {
                display: inline-block;
                margin-right: 10px;
            }
        }
    }

    // object map form
    .object_map {

        .object_map_field {

            label {
                display: block;
            }
        }
    }

    // object map data
    .object_map_data {

        li {
            margin-bottom: 8px;
        }

        .label {
            min-width: 150px;
            display: inline-block;
            margin-right: 5px;
            color: #646970;
        }
    }

    /**
     * Select2 elements.
     */
    .select2-drop,
    .select2-dropdown {
        z-index: 999999 !important;
    }

    .select2-results {
        line-height: 1.5;

        .select2-results__option,
        .select2-results__group {
            margin: 0;
            padding: 8px;
        }

        .description {
            display: block;
            //color: #8c8f94;
            padding-top: 4px;
        }
    }

    .select2-dropdown {
        border-color: $border-color;
    }

    .select2-dropdown--below {
        box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    }

    .select2-dropdown--above {
        box-shadow: 0 -1px 1px rgba(0, 0, 0, 0.1);
    }

    .select2-container {

        .select2-selection {
            border-color: #ddd;
        }

        .select2-search__field {
            min-width: 150px;
        }

        .select2-selection--single {
            height: 32px;

            .select2-selection__rendered {
                line-height: 2;
                padding-right: 24px;
            }

            .select2-selection__arrow {
                right: 3px;
                height: 30px;
            }
        }

        .select2-selection--multiple {
            min-height: 28px;
            border-radius: 0;
            line-height: 1.5;

            li {
                margin: 0;
            }

            .select2-selection__choice {
                padding: 2px 6px;

                .description {
                    display: none;
                }
            }
        }

        .select2-selection__clear {
            color: #999;
            margin-top: -1px;
        }

        .select2-search--inline
        .select2-search__field {
            font-family: inherit;
            font-size: inherit;
            font-weight: inherit;
            padding: 3px 0;
        }

        .select2-selection__rendered.ui-sortable li {
            cursor: move;
        }
    }

    /*.woocommerce table.form-table .select2-container {
        min-width: 400px !important;
    }*/

}

// messages to display
.salesforce_user_ajax_message {
    border-left: 4px solid $success-color;
    box-shadow: $box-shadow-less;
    margin: 5px 0 $vertical-space;
    padding: 1px 12px;

    p {
        margin: 0.5em 0;
        padding: 2px;
    }
}

// profile table for salesforce info
.mapped-salesforce-user {
    width: auto;

    caption {
        border: 1px solid $border-color;
        border-bottom: 0;
        box-shadow: $box-shadow-more;
        color: #555;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.3;
        padding: 8px $horizontal-space;
        text-align: left;
    }

    tr th {
        border-right: 1px solid $border-color;
        font-size: 13px;
        width: 140px;
    }
}