getdave / Tanlinell

Boilerplate Wordpress theme for rapid development of new WP themes. Based on the great work of the _s ("Underscore") theme.
GNU General Public License v2.0
6 stars 2 forks source link

Standardise MQ mixins #280

Closed getdave closed 10 years ago

getdave commented 10 years ago

At the moment there are x2 variants of MQ mixins. This is a maintainability nightmare.

Also the media-queries mixins such as min-screen and screen need to contain the $fix-mqs conditional.


@mixin screen($resMin, $resMax)
{
  @if ($is-oldie == true or $isFixed == true) {
      // Check if we're IE. If so then just return the content sans-media query
      @if $fix-mqs >= $resMin {
          @content;
      }
  } @else {
    @media screen and (min-width: $resMin) and (max-width: $resMax)
    {
      @content;
    }
  }
}

@mixin max-screen($res)
{
  @media screen and (max-width: $res)
  {
    @content;
  }
}

@mixin min-screen($res)
{
  @if ($is-oldie == true or $isFixed == true) {
      // Check if we're IE. If so then just return the content sans-media query
      @if $fix-mqs >= $res {
          @content;
      }
  } @else {
    @media screen and (min-width: $res)
    {
      @content;
    }
  }
}