@use '../variables.scss' as var;

@mixin SnControlGroup($otherClass: '') {
    .#{var.$classPrefix}ControlGroup {
        display: flex;

        &-prepend {
            display: flex;

            .#{var.$classPrefix}Btn {
                display: block;
                border-radius: 0;

                &:first-child {
                    border-top-left-radius: var.$borderRadiusBase;
                    border-bottom-left-radius: var.$borderRadiusBase;
                }
            }
        }

        &-input {
            flex: 1 1 auto;

            &:not(:first-child) {
                .#{var.$classPrefix}Form-control {
                    border-top-left-radius: 0;
                    border-bottom-left-radius: 0;
                }

                @if $otherClass !='' {
                    #{$otherClass} {
                        border-top-left-radius: 0;
                        border-bottom-left-radius: 0;
                    }
                }
            }

            &:not(:last-child) {
                .#{var.$classPrefix}Form-control {
                    border-top-right-radius: 0;
                    border-bottom-right-radius: 0;
                }

                @if $otherClass !='' {
                    #{$otherClass} {
                        border-top-right-radius: 0;
                        border-bottom-right-radius: 0;
                    }
                }
            }
        }

        &-append {
            display: flex;

            .#{var.$classPrefix}Btn {
                display: block;
                border-radius: 0;

                &:last-child {
                    border-top-right-radius: var.$borderRadiusBase;
                    border-bottom-right-radius: var.$borderRadiusBase;
                }
            }
        }
    }
}