/**
 * @license chowa v1.1.3
 *
 * Copyright (c) Chowa Techonlogies Co.,Ltd.(http://www.chowa.cn).
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
@import "./variables.scss";

@mixin btn {
    margin: 0;
    outline: none;
    border-width: 1px;
    border-style: solid;
    transition: border-color $anim-duration ease-in-out, background-color $anim-duration ease-in-out, color $anim-duration ease-in-out, box-shadow $anim-duration ease-in-out;
    display: inline-block;
    border-radius: $border-radius-base;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    cursor: pointer;
}

@mixin io-hover($color: $primary-color) {
    border-color: $color;
}

@mixin io-focus($color: $primary-color) {
    box-shadow: 0 1px 2px 3px rgba(red($color), green($color), blue($color), 0.15);
    @include io-hover($color);
}

@mixin text-overflow($line: 1) {
    @if $line==1 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    @else {
        display: -webkit-box;
        -webkit-line-clamp: $line;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@mixin disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

@mixin dropdown-content($bg-color: $background-color-light) {
    background-color: $bg-color;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: $border-radius-base;
}

@mixin scrollbar($scrollX: true, $scrollY: true) {
    @if $scrollX {
        overflow-x: auto;
    }
    @else {
        overflow-x: hidden;
    }
    @if $scrollY {
        overflow-y: auto;
    }
    @else {
        overflow-y: hidden;
    }
}

@mixin link {
    color: $link-color;
    transition: color 0.2s ease-in;
    cursor: pointer;
    text-decoration: none;

    &:hover {
        color: $link-color-active;
    }
}

@mixin has-error {
    border-color: $danger-color;
}
