// Grid - Friendly Classes

@use "sass:math";

//
// Creates "friendly" classes that are easier to read, use, and
// understand than standard Boostrap grid classes, such as -half,
// -quarter, etc.
// Placeholders are defined below, in the `$widths` map.
// These always print, regardless of grid settings.
//
// Styleguide Grid.Factory.Friendly class map
//
// Access: Public
//
// Since: 1.2.0

$widths: (
	quarter: 		$grid-number-columns * math.div( 1, 4 ),
	third: 			$grid-number-columns * math.div( 1, 3 ),
	half:				$grid-number-columns * math.div( 1, 2 ),
	two-third:		$grid-number-columns * math.div( 2, 3 ),
	three-quarter:	$grid-number-columns * math.div( 3, 4 ),
	full: 			$grid-number-columns,
	remove: 			0
);


// Creates friendly classes
// Creates "friendly" classes that are easier to read, use, and
// understand than standard Boostrap grid classes, such as -half,
// -quarter, etc.
// Placeholders are defined below, in the `$widths` map.
// These always print, regardless of grid settings.
//
// Styleguide Grid.Factory.Create friendly classes
//
// Access: Public
//
// Since: 1.2.0

@each $width, $columns in $widths {
	%col-#{$width} {
		@extend %col-#{$columns} !optional;
	}

	@if $burf-extras {
		.col-#{$width} {
			@extend %col-#{$width} !optional;
		}
	}

	@each $feature, $supported in $grid-supports {
		@if $supported {
			%col-#{$feature}-#{$width} {
				@extend %col-#{$feature}-#{$columns} !optional;
			}

			@if $burf-extras {
				.col-#{$feature}-#{$width} {
					@extend %col-#{$feature}-#{$width} !optional;
				}
			}
		}
	}

	@each $bp-name, $bp-variable in $grid-breakpoints {
		%col-#{$bp-name} {

			&-#{$width} {
				@extend %col-#{$bp-name}-#{$columns} !optional;
			}

			@each $feature, $supported in $grid-supports {
				@if $supported {
					&-#{$feature}-#{$width} {
						@extend %col-#{$bp-name}-#{$feature}-#{$columns} !optional;
					}
				}
			}
		}

		@if $burf-extras {
			.col-#{$bp-name} {
				&-#{$width} {
					@extend %col-#{$bp-name}-#{$width} !optional;
				}

				@each $feature, $supported in $grid-supports {
					@if $supported {
						&-#{$feature}-#{$width} {
							@extend %col-#{$bp-name}-#{$feature}-#{$width} !optional;
						}
					}
				}
			}
		}
	}
}
