Sha256: 3a329566a5f682ec6f1d6a890be69eda6bbbf95cd526077dae6e821c3cc95d89

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

@import "settings";

@function set-breakpoint(
  $min            : false,
  $max            : false,
  $custom         : false,
  $legacy-support : false
  ) {

  @if (not $min) and (not $max) and (not $custom) {
    @warn "Either $min, $max, or $custom must be defined for set-breakpoint to work.";
  }

  @if $min and $max {
    // Both $min and $max
    @return "(min-width: #{ $min }) and (max-width: #{ $max })", $legacy-support;
  } @else {
    @if $min and (not $max) {
      // Min only:
      @return "(min-width: #{ $min })", $legacy-support;
    }
    @if $max and (not $min) {
      // Max only:
      @return "(max-width: #{ $max })", $legacy-support;
    } @else {
      // Custom:
      @return $custom, $legacy-support;
    }
  }
}

@mixin at-breakpoint( 
  $breakpoint,
  $legacy-support: false
  ) {
  
  // Setting variable for reference 
  // in the content of the mixin call
  $at-breakpoint: true;

  @media #{ nth( $breakpoint, 1 ) } {
    @content;
  }
  @if $legacy-support or nth( $breakpoint, 2 ) {
    #{ $legacy-selector } & {
      /* Fallback for browsers not supporting media queries */
      @content;
    }
  }

  // Reset reference
  $at-breakpoint: false;
}


Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ezy-0.3.3 sass/ezy/_media.scss
ezy-0.3.2 sass/ezy/_media.scss
ezy-0.3.1.beta sass/ezy/_media.scss
ezy-0.3.0.beta sass/ezy/_media.scss
ezy-0.2.9 sass/ezy/_media.scss
ezy-0.2.8 sass/ezy/_media.scss
ezy-0.2.7.alpha sass/ezy/_media.scss