._global {
    @import "./button.mixin";
}

._global {
    @font-face {
        font-family: 'fit-button';
        src: url('./font/fit-button.eot');
        src: url('./font/fit-button.eot') format('embedded-opentype'),
        url('./font/fit-button.ttf') format('truetype'),
        url('./font/fit-button.woff') format('woff'),
        url('./font/fit-button.svg') format('svg');
        font-weight: normal;
        font-style: normal;
    }

    [class^="fit-button-"], [class*=" fit-button-"] {
        /* use !important to prevent issues with browser extensions that change fonts */
        font-family: 'fit-button' !important;
        speak: none;
        font-style: normal;
        font-weight: normal;
        font-variant: normal;
        text-transform: none;
        line-height: 1;

        /* Better Font Rendering =========== */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .fit-button-loading:before {
        content: "\e982";
    }
}

& {
    transition: opacity .3s;
    font-size: 14px;
    font-family: Source Sans Pro, Helvetica Neue, Helvetica, Arial, sans-serif;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    padding: 0;
    height: 32px;
    position: relative;
    overflow: hidden;
    .button-container {
        display: flex;
        align-items: stretch;
        height: 100%;
        .text-child {
            padding: 0 15px;
            display: flex;
            flex-grow: 1;
            align-items: center;
            justify-content: center;
        }
    }

    // 旋转动画
    .animation-spin {
        animation: fa-spin 2s infinite linear;
    }
}

.loading-container {
    transition: width .3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0;
    overflow: hidden;
    &.show {
        width: 22px;
    }
}

&.btn {
    display: inline-block;
    font-weight: 500;
    border-radius: $btn-border-radius;
    outline: 0 !important;
    border: 1px solid transparent;
    line-height: 1.42857143;
    white-space: nowrap;
    touch-action: manipulation;
    cursor: pointer;
    user-select: none;
    &.disabled {
        pointer-events: none;
        cursor: not-allowed;
        box-shadow: none;
        opacity: .65;
    }
}

&.btn-lg {
    height: 50px;
}

&.btn-xs {
    height: 30px;
}

&.btn-sm {
    height: 25px;
}

&.btn-link {
    color: $btn-text-color;
    &.active {
        box-shadow: none;
    }
}

&.btn-default {
    @include button-variant($btn-text-color, $btn-default-bg, $btn-default-border, true);
    background-color: #fff;
    border-bottom-color: darken($btn-default-border, 2%);
    box-shadow: (0 1px 1px rgba(90, 90, 90, 0.1));
    &.btn-bg {
        border-color: rgba(0, 0, 0, 0.1);
        background-clip: padding-box;
    }
    &.active {
        background: whitesmoke;
    }
}

&.btn-primary {
    @include button-variant(#fff, $brand-primary, $brand-primary, false);
}

&.btn-success {
    @include button-variant(#fff, $brand-success, $brand-success, false);
}

&.btn-info {
    @include button-variant(#fff, $brand-info, $brand-info, false);
}

&.btn-warning {
    @include button-variant(#fff, $brand-warning, $brand-warning, false);
    &:hover, &:active, &.active {
        color: #ffffff !important;
        background-color: #f9d21a;
        border-color: #f9cf0b;
    }
}

&.btn-danger {
    @include button-variant(#fff, $brand-danger, $brand-danger, false);
}

&.btn-dark {
    @include button-variant(#fff, $brand-dark, $brand-dark, false);
}

&.btn-black {
    @include button-variant(#fff, $brand-black, $brand-black, false);
}

&.btn-secondary {
    @include button-variant(#58666e, $brand-secondary, $brand-secondary, true);
    &:hover:not(.active) {
        border: 1px solid #ccc;
    }
}

&.btn-icon {
    padding: 0 !important;
    text-align: center;
    width: 34px;
    height: 34px;
    i {
        top: -1px;
        position: relative;
        line-height: 34px;
    }
}

&.btn-sm {
    line-height: 1.5rem;
}

&.btn-rounded {
    border-radius: 50px;
    padding-left: 15px;
    padding-right: 15px;
    &.btn-lg {
        padding-left: 25px;
        padding-right: 25px;
    }
}

&.btn {
    > i {
        &.pull-left,
        &.pull-right {
            line-height: 2.5rem;
        }
    }
}

&.btn-block {
    padding-left: 12px;
    padding-right: 12px;
}

&.btn-group-vertical > .btn:first-child:not(:last-child) {
    border-top-right-radius: $border-radius-base;
}

&.btn-group-vertical > .btn:last-child:not(:first-child) {
    border-bottom-left-radius: $border-radius-base;
}

&.btn-addon {
    i {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(0, 0, 0, 0.1);
        width: 30px;
        position: relative;
        border-radius: $btn-border-radius 0 0 $btn-border-radius;
    }
    &.btn-sm {
        i {
            width: 30px;
        }
    }
    &.btn-lg {
        i {
            width: 50px;
        }
    }
    &.btn-xs {
        i {
            width: 30px;
        }
    }
    &.btn-sm {
        i {
            width: 25px;
        }
    }
    &.btn-default {
        i {
            background-color: transparent;
            border-right: 1px solid $border-color;
        }
    }
}

&.btn-groups .btn {
    margin-bottom: 5px;
}

@keyframes fit-button-ripple {
    0% {
        opacity: 1;
        transform: scale(0);
    }
    100% {
        opacity: 0;
        transform: scale(2.5);
    }
}
