SU-SWS/decanter

View on GitHub
core/src/scss/utilities/mixins/breakpoint/_grid-media-max.scss

Summary

Maintainability
Test Coverage

///
/// Media query of at most the maximum breakpoint width. No query for the largest breakpoint.
/// Applies to the passed through breakpoint and below.
///
/// @name su-grid-media-max
///
/// @param {breakpoint} $name - The breakpoint key code eg: 'sm'
/// @param {breakpoint} $breakpoints - A map of each of the screen breakpoint sizes.
///
/// @group mixin
@mixin grid-media-max($name: 'xs', $breakpoints: $su-grid-screens) {
  $max: breakpoint-max($name, $breakpoints);
  @if $max {
    @media (max-width: $max) {
      @content;
    }
  }
  @else {
    @content;
  }
}