/ Background Patterns

Corners Background Pattern

Corners Background Pattern

Corners Pattern

A CSS Corners Background Pattern.

Made with

Html
Css/scss

Author

yoksel

Css

$bgcolor: #F2ECD3;
$transparent: rgba(255, 255, 255, 0);

$color-1: #F2F2F2;
$color-2: #C6E070;
$color-3: #91C46C;
$color-4: #287D7D;
$color-5: #1C344D;

$size: 2em;
$big-size: $size*2;
$min: $size*.2;
$max: $size*.51;

$diff: $max - $min;

HTML {
  height: 100%;
  }
BODY {
  background: 
    linear-gradient(to left bottom,
      $transparent $min,
      $color-5 $min, $color-5 $max, 
      $transparent $max
      ) 0 0,
    linear-gradient(to right top,
      $transparent $min,
      $color-5 $min, $color-5 $max, 
      $transparent $max
      ) $size 0,
    
    linear-gradient(to left bottom,
      $transparent $min,
      $color-3 $min, $color-3 $max, 
      $transparent $min
      ) 0 $max,
    linear-gradient(to right top,
      $transparent $min,
      $color-3 $min, $color-3 $max, 
      $transparent $min
      ) $size $max,
    
    linear-gradient(to left bottom,
      $transparent $min,
      $color-4 $min, $color-4 $max, 
      $transparent $min
      ) 0 $max*2,
    linear-gradient(to right top,
      $transparent $min,
      $color-4 $min, $color-4 $max, 
      $transparent $min
      ) $size $max*2,
    
    linear-gradient(to left bottom,
      $transparent $min,
      $color-2 $min, $color-2 $max, 
      $transparent $min
      ) 0 $max*3,
    linear-gradient(to right top,
      $transparent $min,
      $color-2 $min, $color-2 $max, 
      $transparent $min
      ) $size $max*3,
    /* - - - - - */
    linear-gradient(to right bottom,
      $transparent $min,
      $color-2 $min, $color-2 $max, 
      $transparent $max
      ) 0 0,
    linear-gradient(to left top,
      $transparent $min,
      $color-2 $min, $color-2 $max, 
      $transparent $max
      ) $size 0,
    
    linear-gradient(to right bottom,
      $transparent $min,
      $color-5 $min, $color-5 $max, 
      $transparent $min
      ) 0 $max,
    linear-gradient(to left top,
      $transparent $min,
      $color-5 $min, $color-5 $max, 
      $transparent $min
      ) $size $max,
    
    linear-gradient(to right bottom,
      $transparent $min,
      $color-3 $min, $color-3 $max, 
      $transparent $min
      ) 0 $max*2,
    linear-gradient(to left top,
      $transparent $min,
      $color-3 $min, $color-3 $max, 
      $transparent $min
      ) $size $max*2,
    
    linear-gradient(to right bottom,
      $transparent $min,
      $color-4 $min, $color-4 $max, 
      $transparent $min
      ) 0 $max*3,
    linear-gradient(to left top,
      $transparent $min,
      $color-4 $min, $color-4 $max, 
      $transparent $min
      ) $size $max*3
    ;
  background-size:  $big-size $big-size;
  background-color: $bgcolor;
  background-repeat: repeat;
  font: 16px/2 'Trebuchet MS', Verdana, sans-serif;
  }

Demo

See the Pen Corners by yoksel (@yoksel) on CodePen.

CodeTea

A Nice collection of often useful examples done in HTML JavaScript CSS.

Read More