@import "../styles/base/fn.wxss";

.button(@theme, @color) {
    &--@{theme},
    &--@{theme}--disabled {
        .button-style(@color);
    }

    &--@{theme}&--outline,
    &--@{theme}&--outline&--disabled {
        .button-outline(@color);
    }

    &--@{theme}&--clear,
    &--@{theme}&--clear&--disabled {
        .button-clear(@color);
    }

    &--@{theme}&--clear&--hover {
        .button-hover(transparent, @color);
    }

    &--@{theme}&--hover {
        .button-hover(@color);
    }
}

.@{wuxClassNamePrefix}-button {
    position: relative;
    display: inline-block;
    // margin-left: auto;
    // margin-right: auto;
    // padding-left: 14px;
    // padding-right: 14px;
    box-sizing: border-box;
    // font-size: 18px;
    // text-align: center;
    // text-decoration: none;
    // line-height: 2.55555556;
    // border-radius: 5px;
    // -webkit-tap-highlight-color: transparent;
    // overflow: hidden;
    // color: #000000;
    // background-color: #F8F8F8;

    margin: 0;
    padding: 0 12px;
    min-width: 52px;
    min-height: 44px;
    border: none;
    border-radius: 4px;
    vertical-align: middle;
    text-align: center;
    text-overflow: ellipsis;
    font-size: 16px;
    line-height: 42px;
    cursor: pointer;

    &:after {
        content: " ";
        width: 100%;
        height: 100%;
        position: absolute;
        top: -6px;
        right: -6px;
        bottom: -6px;
        left: -6px;
        border: none;
        transform: none;
        transform-origin: 0 0;
        box-sizing: border-box;
        border-radius: 0;
    }

    &--bordered {
        border: 1px solid transparent;
    }

    &--disabled {
        opacity: .4 !important;
    }

    &--small {
        padding: 2px 4px 1px;
        min-width: 28px;
        min-height: 30px;
        font-size: 12px;
        line-height: 26px;
    }

    &--large {
        padding: 0 16px;
        min-width: 68px;
        min-height: 59px;
        font-size: 20px;
        line-height: 53px;
    }

    &--block,
    &--full {
        width: 100%;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    &--block {
        display: block;
        clear: both;

        &:after {
            clear: both;
        }
    }

    &--full {
        display: block;
        margin-right: 0;
        margin-left: 0;
        border-right-width: 0;
        border-left-width: 0;
        border-radius: 0;
    }

    &--outline&--hover {
        color: #fff !important;
    }

    .button(light, @light);
    .button(stable, @stable);
    .button(positive, @positive);
    .button(calm, @calm);
    .button(assertive, @assertive);
    .button(balanced, @balanced);
    .button(energized, @energized);
    .button(royal, @royal);
    .button(dark, @dark);

    &--light {
        .button-style(@light, transparent, @dark);
    }

    &--light&--outline {
        .button-outline(@light-inverse);
    }

    &--light&--clear&--hover {
        .button-hover(transparent, @light-inverse);
    }

    &--light&--hover {
        .button-hover(@light);
    }

    &--stable {
        .button-style(@stable, transparent, @dark);
    }

    &--stable&--outline {
        .button-outline(@stable-inverse);
    }

    &--stable&--clear&--hover {
        .button-hover(transparent, @stable-inverse);
    }

    &--stable&--hover {
        .button-hover(@stable);
    }
}
