// Headings Styles
@mixin headings($from: 1, $to: 6){
	@for $i from $from through $to {
		h#{$i}, .h#{$i} {
			@content
		}
	}
}

// Rem output with px fallback
@mixin font-size($sizeValue: 1) {
	font-size: ($sizeValue * 16) * 1px;
	font-size: $sizeValue * 1rem;
}

// Center block
@mixin center-block {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

// Clearfix
@mixin clearfix() {
	content: "";
	display: table;
	table-layout: fixed;
}

// Clear after (not all clearfix need this also)
@mixin clearfix-after() {
	clear: both;
}

// Helper method to strip unit suffixes from numbers for calculations.
@function strip-unit( $number ) {
	@if type-of( $number ) == 'number' and not unitless( $number ) {
		@return $number / ( $number * 0 + 1 );
	}

	@return $number;
}

// Helper method to use first unit suffix of $value1 for multiplication calculations.
@function multiply-use-first-unit( $value1, $value2 ) {
	@return $value1 * strip-unit( $value2 );
}

// Alignment control mixin.
@mixin align-control() {
	&.flex-row {
		&.nw {
			align-items: flex-start !important;
			justify-content: flex-start !important;
			@content;
		}
		&.n {
			align-items: flex-start !important;
			justify-content: center !important;
			@content;
		}
		&.ne {
			align-items: flex-start !important;
			justify-content: flex-end !important;
			@content;
		}
		&.w {
			align-items: center !important;
			justify-content: flex-start !important;
			@content;
		}
		&.c {
			align-items: center !important;
			justify-content: center !important;
			@content;
		}
		&.e {
			align-items: center !important;
			justify-content: flex-end !important;
			@content;
		}
		&.sw {
			align-items: flex-end !important;
			justify-content: flex-start !important;
			@content;
		}
		&.s {
			align-items: flex-end !important;
			justify-content: center !important;
			@content;
		}
		&.se {
			align-items: flex-end !important;
			justify-content: flex-end !important;
			@content;
		}
	}

	&, &.flex-column {
		&.nw {
			align-items: flex-start !important;
			justify-content: flex-start !important;
			@content;
		}
		&.n {
			align-items: center !important;
			justify-content: flex-start !important;
			@content;
		}
		&.ne {
			align-items: flex-end !important;
			justify-content: flex-start !important;
			@content;
		}
		&.w {
			align-items: flex-start !important;
			justify-content: center !important;
			@content;
		}
		&.c {
			align-items: center !important;
			justify-content: center !important;
			@content;
		}
		&.e {
			align-items: flex-end !important;
			justify-content: center !important;
			@content;
		}
		&.sw {
			align-items: flex-start !important;
			justify-content: flex-end !important;
			@content;
		}
		&.s {
			align-items: center !important;
			justify-content: flex-end !important;
			@content;
		}
		&.se {
			align-items: flex-end !important;
			justify-content: flex-end !important;
			@content;
		}
	}

}
