<div class='responsive-component'>
  sass and media queries example
</div>
@import "compass/css3";

body{
  xbackground-color: #1d1f20;
}

/* Setup */

$device-extra-small-width: 480px;
$device-small-width: 768px;
$device-medium-width: 992px;
$device-large-width: 1200px;

@mixin device-extra-small {
  @media (min-width: #{$device-extra-small-width}) { @content; }
}
@mixin device-small {
  @media (min-width: #{$device-small-width}) { @content;  }
}
@mixin device-medium {
  @media (min-width: #{$device-medium-width}) { @content;  }
}
@mixin device-large {
  @media (min-width: #{$device-large-width}) { @content;  }
}

/* Usage */

.responsive-component {  
  padding: 10px;
  -webkit-transition: all 1s;
  transition: all 1s;
  
  &::before{
    content: ' extra extra small - ';
    @include device-extra-small { content: ' device extra small - '; }
    @include device-small { content: ' device small - '; }
    @include device-medium { content: ' device medium - '; }
    @include device-large { content: ' device large - '; }
  }
 
   background: tomato;
  
   @include device-extra-small {
    font-size: 120%;
    background: aqua;
  }
   @include device-small {
    font-size: 140%;
    background: orange;
  }
  @include device-medium {
    font-size: 160%;
    background: lime;
  }
  @include device-large {
    font-size: 180%;
    background: yellow;
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.