@use 'sass:string';
@use '../../functions/math/with-unit/with-unit.scss' as *;

/**
 * Sets the element size.
 * Shorthand for both `width` and `height` properties.
 *
 * @param    {number}    $inline-size                  Inline size of the element.
 * @param    {number}    $block-size [$inline-size]    Block size of the element.
 */
@mixin box($inline-size, $block-size: $inline-size) {
	$inline-size: with-unit($inline-size);
	$block-size: with-unit($block-size);

	$normalized-inline-size: null;
	$normalized-block-size: null;

	@if ($inline-size != 'n') {
		$normalized-inline-size: string.unquote(#{$inline-size});
	}

	@if ($block-size != 'n') {
		$normalized-block-size: string.unquote(#{$block-size});
	}

	inline-size: $normalized-inline-size;
	block-size: $normalized-block-size;
}
