@use 'config' as *;
@use 'breakpoint' as *;

@import 'mixins';

/// Generate the CSS for a grid for the given breakpoints and gutters
/// @param {Map} $breakpoints [$grid-breakpoints] - The default breakpoints
/// @param {Number} $grid-gutter [$grid-gutter] - The default gutters
/// @param {Number} $condensed-gutter [$grid-gutter-condensed] - The condensed mode gutter
/// @access public
/// @group @cds/grid
@mixin flex-grid(
  $breakpoints: $grid-breakpoints,
  $grid-gutter: $grid-gutter,
  $condensed-gutter: $grid-gutter-condensed
) {
  .#{$prefix}-grid {
    @include -make-container($breakpoints);
  }

  @include cds-largest-breakpoint($breakpoints) {
    .#{$prefix}-grid--wide {
      max-inline-size: 100%;
    }
  }

  .#{$prefix}-row {
    @include -make-row();
  }

  .#{$prefix}-row-padding [class*='#{$prefix}-col'],
  .#{$prefix}-col-padding {
    padding-block: $grid-gutter * 0.5;
  }

  .#{$prefix}-grid-condensed [class*='#{$prefix}-col'] {
    padding-block: $condensed-gutter * 0.5;
  }

  @include -make-grid-columns($breakpoints, $grid-gutter);
  @include -no-gutter();
  @include -hang($grid-gutter);
}
