/*
 * Copyright (c) 2016-2025 Broadcom. All Rights Reserved.
 * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
 * 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';
@use '../../../utils/variables/variables.layout';

@mixin clr-make-container() {
  width: 100%;
  padding-right: variables.$clr-grid-container-padding;
  padding-left: variables.$clr-grid-container-padding;
  margin-right: auto;
  margin-left: auto;
}

@mixin clr-make-row() {
  display: flex;
  flex-wrap: wrap;
  margin-right: variables.$clr-grid-row-margin;
  margin-left: variables.$clr-grid-row-margin;
}

@mixin clr-make-col($size, $columns: variables.$clr-grid-columns) {
  flex: 0 0 math.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: math.percentage(math.div($size, $columns));
}

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