triangle-background()
  $height = arguments[0] || 1em
  $width = ($height * sin(30deg)) / sin(60deg)
  $color-1 = arguments[1] || black
  $color-2 = arguments[2] || white
  $color-3 = arguments[3] || $color-2
  $color-4 = arguments[4] || $color-1
  
  background linear-gradient(120deg, transparent 75%, $color-2 75%) 0 0, linear-gradient(240deg, transparent 75%, $color-2 75%) 0 0, linear-gradient(120deg, transparent 75%, $color-3 75%) ($width / 2) ($height / -2), linear-gradient(240deg, transparent 75%, $color-3 75%) ($width / 2) ($height / 2), linear-gradient($color-1 50%, $color-4 50%)
  background-size $width $height

body
  triangle-background(100px #48183b #a13582 #772760 #39132e)
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.