@use 'sass:map';
@use '../../config';
@use '../../functions' as *;
@use '../../schemas/' as *;
@use '../../../utils/map' as *;
@use '../../../elevations/' as *;

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

/// Ripple Theme
///
/// This theme has no automatic token derivation. Only one token: color.
///
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
/// @param {Color} $color [null] - The color of the ripple.
/// @requires $light-material-schema
/// @example scss - Change the color
///   $my-ripple-theme: igx-ripple-theme($color: yellow);
///   // Pass the theme to the css-vars() mixin
///   @include css-vars($my-ripple-theme);
@function ripple-theme($schema: $light-material-schema, $color: null) {
    $selector: (#{config.element-prefix() + '-' + 'ripple'}, #{'[' + config.element-prefix() + 'Ripple]'});
    $ripple-schema: ();

    @if map.has-key($schema, 'ripple') {
        $ripple-schema: map.get($schema, 'ripple');
    } @else {
        $ripple-schema: $schema;
    }

    $theme: digest-schema($ripple-schema);

    @return extend(
        $theme,
        (
            selector: $selector,
            color: $color,
        )
    );
}
