@use 'base' as *;
@use '../schemas' as *;
@use 'igniteui-theming/sass/color' as *;

////
/// @group themes
/// @access public
/// @author <a href="https://github.com/simeonoff" target="_blank">Simeon Simeonoff</a>
////

/// A wrapper around the theme mixin. Creates a global bootstrap-like theme that can be used with light backgrounds.
/// @param {Map} $palette - An palette to be used by the global theme.
/// @param {List} $exclude [( )] - A list of ig components to be excluded from the global theme styles.
/// @see {mixin} theme
@mixin bootstrap-light-theme(
    $palette,
    $exclude: (),
    $roundness: null,
    $elevation: true,
) {
    $primary: color($palette, 'primary');
    $secondary: color($palette, 'secondary');
    $surface: color($palette, 'surface');
    $info: color($palette, 'info');
    $success: color($palette, 'success');
    $warn: color($palette, 'warn');
    $error: color($palette, 'error');

    @include theme(
        $palette: palette(
            $primary,
            $secondary,
            $surface: if($surface != #f8f9fa, $surface, #f8f9fa),
            $gray: #212529,
            $info: $info,
            $success: $success,
            $warn: $warn,
            $error: $error
        ),
        $schema: $light-bootstrap-schema,
        $exclude: $exclude,
        $roundness: $roundness,
        $elevation: $elevation,
    );
}

/// A wrapper around the theme mixin. Creates a global bootstrap-like theme that can be used with dark backgrounds.
/// @param {Map} $palette - An palette to be used by the global theme.
/// @param {List} $exclude [( )] - A list of ig components to be excluded from the global theme styles.
/// @see {mixin} theme
@mixin bootstrap-dark-theme(
    $palette,
    $exclude: (),
    $roundness: null,
    $elevation: true,
) {
    $primary: color($palette, 'primary');
    $secondary: color($palette, 'secondary');
    $surface: color($palette, 'surface');
    $info: color($palette, 'info');
    $success: color($palette, 'success');
    $warn: color($palette, 'warn');
    $error: color($palette, 'error');

    @include theme(
        $palette: palette(
            $primary,
            $secondary,
            $surface: if($surface != white, $surface, #222),
            $gray: #fff,
            $info: $info,
            $success: $success,
            $warn: $warn,
            $error: $error
        ),
        $schema: $dark-bootstrap-schema,
        $exclude: $exclude,
        $roundness: $roundness,
        $elevation: $elevation,
    );
}
