@charset "UTF-8";

// @description
// * translate-y mixin.
// * This mixin provides a convenient way to apply horizontal translation
// * using the `transform` property with proper vendor prefixes.
// * It supports both numerical values for translation distances and
// * predefined keywords such as:
// * `inherit`, `initial`, `revert`, `unset`, and `none`.

// @access public

// @version 1.4.0

// @author Khaled Mohamed

// @license MIT

// @repository: https://github.com/Black-Axis/sass-pire

// @reference: https://developer.mozilla.org/en-US/docs/Web/CSS/transform

// @namespace transform

// @module transform/translate-y

// @dependencies:
// * - meta.type-of (SASS function).
// * - math.unit (SASS function).
// * - var.$main-units (variable).
// * - LibMixin.prefixing-all (mixin).
// * - Error.throw (function).

// @param {Number|String} $x
// * The vertical translation distance.
// * Default: 1px.
// * If a number, it must have a valid unit from the main-units list.
// * If a string, it can be: (inherit, initial, revert, unset, none).

// @example
// * .example {
// *   @include translate-y(10px);
// * }

// @output
// * .example {
// *   -webkit-transform: translateY(10px);
// *   -moz-transform: translateY(10px);
// *   -ms-transform: translateY(10px);
// *   -o-transform: translateY(10px);
// *   transform: translateY(10px);
// * }

@use "sass:meta";
@use "sass:list";
@use "sass:math";
@use "../../abstract/global-variables" as var;
@use "../../mixins/vendor-prefixes/prefix" as LibMixin;
@use "../../development-utils/toggle-error-message" as Error;

@mixin translate-y($y: 1px) {
    $transform-props-values: (inherit, initial, revert, unset, none) !default;

    @if meta.type-of($y) == number {
        @if not list.index(var.$main-units, math.unit($y)) {
            content: Error.throw(
                "The parameter of translate-y mixin must has one of these units: (#{var.$main-units})."
            );
        } @else {
            @include LibMixin.prefixing-all(transform, translateY($y));
        }
    } @else if meta.type-of($y) == string {
        @if not list.index($transform-props-values, $y) {
            content: Error.throw(
                "The parameter of translate-y mixin must has one of these values: (#{$transform-props-values})."
            );
        } @else {
            @include LibMixin.prefixing-all(transform, translateY($y));
        }
    } @else {
        content: Error.throw("The value of translate-y mixin must be in a number or a string type.");
    }
}
