@charset "UTF-8";

// @description
// * justify-content mixin.
// * This mixin applies the `justify-content` property with vendor
// * prefixes to a container. It allows you to set the horizontal
// * alignment of flex items along the main axis.

// @access public

// @version 1.2.1

// @author Khaled Mohamed

// @license MIT

// @repository: https://github.com/Black-Axis/sass-pire

// @reference: https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content

// @namespace main-props

// @module main-props/justify-content

// @dependencies:
// * - var.$justify-content-props (variable).
// * - var.$justify-content-values (variable).
// * - LibFunc.is-in-list (function).
// * - Error.toggle (function).

// @param {String} $value
// * The value for `justify-content`.
// * Allowed values: flex-start, flex-end, center, space-between,
// * space-around, space-evenly.
// * Default: flex-start.

// @example
// * .example {
// *   @include justify-content(center);
// * }

// @output:
// * .example {
// *   -webkit-box-pack: start;
// *   -webkit-justify-content: start;
// *   -ms-flex-pack: start;
// *   -moz-justify-content: start;
// *   justify-content: start;
// * }

// @note
// * There are two mixins in this file.
// * The first is the (justify-content) mixin and second is (j-c) mixin.
// * The second one is for only simplicity when using (justify-content) mixin.
// * The core logic of (j-c) mixin is to call the first one.
// * You can use one of them as you want.

@use "../../../abstract/global-variables" as var;
@use "../../../functions/global/is-in-list" as LibFunc;
@use "../../../development-utils/toggle-error-message" as Error;

@mixin justify-content($value: flex-start) {
    @if LibFunc.is-in-list(var.$justify-content-values, $value) {
        @each $prop in var.$justify-content-props {
            #{$prop}: $value;
        }
    } @else {
        content: Error.throw("The parameter of justify-content mixin must be one of: (#{var.$justify-content-values}).");
    }
}

@mixin j-c($value: flex-start) {
    @include justify-content($value);
}
