@import '~@angular/material/theming';

/*--------------------------------------------------------------------------
//
//  Methods
//
//-------------------------------------------------------------------------*/

@mixin vi-mat-core-bootstrap($typography) {
    // _reset.scss
    body {
        @include mat-typography-level-to-styles($typography, body-1);
    }
}

@mixin vi-mat-theme-bootstrap($theme, $text-primary-default, $text-accent-default) {
    $warn: map-get($theme, warn);
    $accent: map-get($theme, accent);
    $primary: map-get($theme, primary);
    $is-dark: map-get($theme, is-dark);
    $background: map-get($theme, background);
    $foreground: map-get($theme, foreground);

    $text-color: map-get($foreground, text);
    $text-accent-color: mat-color($accent, $text-accent-default);
    $text-primary-color: mat-color($primary, $text-primary-default);

    $divider-color: map-get($foreground, divider);

    @if $is-dark {
        $text-accent-color: mat-color($accent);
        $text-primary-color: mat-color($primary);
    }

    // _reset.scss
    color: $text-color;
    background-color: map-get($background, body) !important;

    .bg-primary {
        background-color: $text-primary-color !important;
    }
    .border-primary {
        border-color: $text-primary-color !important;
    }

    .form-control {
        background: transparent;
        color: $text-color;
        border-color: $divider-color;
    }

    .border {
        border-color: $divider-color !important;
        &.solid {
            border: 1px solid $divider-color !important;
        }
        &.dashed {
            border: 1px dashed $divider-color !important;
        }
    }
    .border-top {
        border-color: $divider-color !important;
        &.dashed {
            border-top: 1px dashed $divider-color !important;
        }
    }
    .border-left {
        border-color: $divider-color !important;
        &.dashed {
            border-left: 1px dashed $divider-color !important;
        }
    }
    .border-right {
        border-color: $divider-color !important;
        &.dashed {
            border-right: 1px dashed $divider-color !important;
        }
    }
    .border-bottom {
        border-color: $divider-color !important;
        &.dashed {
            border-bottom: 1px dashed $divider-color !important;
        }
    }

    .background {
        background-color: map-get($background, background) !important;
    }
    .background-body {
        background-color: map-get($background, body) !important;
    }

    .text-base {
        color: $text-color !important;
    }
    .text-accent {
        color: $text-accent-color !important;
    }
    .text-primary {
        color: $text-primary-color !important;
    }
    .text-danger {
        color: mat-color($warn) !important;
    }
    .text-warning {
        color: map-get($foreground, warning-text) !important;
    }
    .text-success {
        color: map-get($foreground, success-text) !important;
    }
    .text-secondary {
        color: map-get($foreground, secondary-text) !important;
    }
}
