@charset "UTF-8";

// @description
// * text-overflow mixin.
// * This mixin provides a convenient way to set how hidden overflow
// * content is signaled to users. It can be clipped, display an ellipsis
// * ('…'), or display a custom string.

// @access public

// @version 1.1.0

// @author Khaled Mohamed

// @license MIT

// @repository: https://github.com/Black-Axis/sass-pire

// @namespace typography

// @module typography/text-overflow

// @dependencies:
// * - meta.type-of (SASS function).
// * - LibFunc.is-in-list (function).
// * - var.var.$text-overflow-props (variable).
// * - var.var.$text-overflow-props-values (variable).
// * - Error.throw (function).

// @param {String} $value
// * The value of the text-overflow CSS property.
// * Default: clip.
// * If a string, it can be:
// * (clip, ellipsis, inherit, revert, revert-layer, unset).

// @example
// * .example {
// *   @include text-overflow(ellipsis);
// * }

// @output
// * .example {
// *   -moz-text-overflow: ellipsis;
// *   text-overflow: ellipsis;
// * }

@use "sass:meta";
@use "sass:list";
@use "../../functions/global/is-in-list" as LibFunc;
@use "../../abstract/global-variables" as var;
@use "../../development-utils/toggle-error-message" as Error;

@mixin text-overflow($value: clip) {
    @if meta.type-of($value) == string {
        @if LibFunc.is-in-list(var.$text-overflow-props-values, $value) {
            @each $prop in var.$text-overflow-props {
                #{$prop}: $value;
            }
        } @else {
            content: Error.throw("The parameter of text-overflow mixin must has one of these values: (#{var.$text-overflow-props-values}).");
        }
    } @else {
        content: Error.throw("The parameter of text-overflow mixin must has one of these values: (#{var.$text-overflow-props-values}).");
    }
}
