@charset "UTF-8";

// @description
// * mie mixin.
// * This mixin generates CSS logical properties for margin-inline-end.
// * It will generate -webkit-margin-end & margin-inline-end properties.

// @access public

// @version 1.1.0

// @author Khaled Mohamed

// @license MIT

// @repository: https://github.com/Black-Axis/sass-pire

// @namespace logical-props

// @module logical-props/mie

// @dependencies:
// * - meta.type-of (SASS function).
// * - math.unit (SASS function).
// * - list.index (SASS function).
// * - var.$all-units (variable).
// * - Error.throw (function).

// @example
// * .example {
// *   @include mie(2rem);
// * }

// @output
// * .example {
// *    margin-inline-end: 2rem;
// *    -webkit-margin-end: 2rem;
// * }

@use "sass:meta";
@use "sass:list";
@use "sass:math";
@use "../../abstract/global-variables" as var;
@use "../../development-utils/toggle-error-message" as Error;

@mixin mie($value: 0) {
    @if meta.type-of($value) != number {
        content: Error.throw("The parameter of mie mixin must be in a number type.");
    } @else {
        $get-unit: math.unit($value);

        @if $get-unit != "" {
            @if list.index(var.$all-units, $get-unit) {
                -webkit-margin-end: $value;
                -moz-margin-end: $value;
                margin-inline-end: $value;
            } @else {
                content: Error.throw("The parameter of mie mixin must be one of these values: (#{var.$all-units}).");
            }
        } @else {
            content: Error.throw("The parameter of mie mixin must have a unit.");
        }
    }
}
