<div class="box-container">
  <div class="box box_1"></div>
  <div class="box box_2"></div>
  <div class="box box_3"></div>
  <div class="box box_4"></div>
</div>
$defaultColor: #6DA34D;
$smallColor: #56445D;
$largeColor: #29294f;
$backgroundColor: #FFBF46;

$small-width: 800px;
$large-width: 1200px;

// Mixin to help add media queries
// @param { String } - small or large
@mixin wider-than($point) {
  @if $point == small {
    @media screen and (min-width: $small-width) {
      @content;
    }
  } @else if $point == large {
    @media screen and (min-width: $large-width) {
      @content;
    }
  }
}

body {
  background-color: $backgroundColor;
  margin: 0;
}

.box-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.box {
  display: block;
  flex-wrap: wrap;
  width: $small-width/2;
  max-width: 100%;
  height: 200px;
  border-radius: 10px;
  margin: 10px;
  background-color: $defaultColor;
  
  @include wider-than(small) {
    width: $small-width - 100px;
    background-color: $smallColor;
  }
  @include wider-than(large) {
    width: $large-width - 100px;
    background-color: $largeColor;    
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.