/*
 * Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.
 * This software is released under MIT license.
 * The full license information can be found in LICENSE in the root directory of this project.
 */

@use 'sass:math';

@mixin clr-make-row() {
  display: flex;
  flex-wrap: wrap;
  margin-right: math.div($clr-grid-gutter-width, -2);
  margin-left: math.div($clr-grid-gutter-width, -2);
}

@mixin clr-make-col($size, $columns: $clr-grid-columns) {
  flex: 0 0 percentage(math.div($size, $columns));
  // Add a `max-width` to ensure content within each column does not blow out
  // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
  // do not appear to require this.
  max-width: percentage(math.div($size, $columns));
}

@mixin clr-make-col-offset($size, $columns: $clr-grid-columns) {
  $num: math.div($size, $columns);
  margin-left: if($num == 0, 0, percentage($num));
}
