@charset "UTF-8";

// @description
// * select mixin.
// * Apply custom selection styles to the browser's selection highlight.

// @access public

// @version 1.2.0

// @author Khaled Mohamed

// @license MIT

// @repository: https://github.com/Black-Axis/sass-pire

// @reference: https://developer.mozilla.org/en-US/docs/Web/CSS/::selection

// @namespace general

// @module general/select

// @dependencies:
// * - meta.type-of (SASS function).

// @param {String|Color} $bg-color
// * The background color of the selection.
// * If a string, it should represent a CSS variable.

// @param {String|Color} $text-color
// * The text color of the selection.
// * If a string, it should represent a CSS variable.

// @example
// * .example {
// *   @include select(#3498db, #ffffff);
// * }

// @output
// * .example::-moz-selection {
// *   background-color: #3498db;
// *   color: #ffffff;
// * }
// * .example::selection {
// *   background-color: #3498db;
// *   color: #ffffff;
// * }

// stylelint-disable selector-no-vendor-prefix

@use "sass:meta";
@use "sass:string";
@use "../../development-utils/toggle-error-message" as Error;

@mixin select($bg-color: #000000, $text-color: #ffffff) {
    @if meta.type-of($bg-color) != string {
        content: Error.throw("Background color (first argument) of select mixin must be in string type.");
    }

    @if meta.type-of($bg-color) != string {
        content: Error.throw("Text color (second argument) of select mixin must be in string type.");
    }

    ::-moz-selection {
        background-color: $bg-color;
        color: $text-color;
    }

    ::selection {
        background-color: $bg-color;
        color: $text-color;
    }
}
