Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="wrapper">
  <div class="figure square"></div>
  <div class="figure rectangle"></div>
</div>
<div class="wrapper">
  <div class="figure circle"></div>
  <div class="figure oval"></div>
  <div class="figure heart"></div>
</div>
<div class="wrapper">
  <div class="figure right-triangle"></div>
  <div class="figure isosceles-triangle"></div>
  <div class="figure triangle"></div>
</div>
<div class="wrapper">
  <div class="figure isosceles-trapezoid"></div>
  <div class="figure rectangular-trapezoid"></div>
  <div class="figure trapezoid"></div>
</div>
<div class="wrapper">
  <div class="figure pentagon"></div>
  <div class="figure hexagon"></div>
  <div class="figure heptagon"></div>
  <div class="figure octagon"></div>
</div>
<div class="wrapper">
  <div class="figure infinity"></div>
</div>
<div class="wrapper">
  <div class="figure equilateral-rhombus"></div>
  <div class="figure rhombus"></div>
</div>
<div class="wrapper">
  <div class="figure pacman"></div>
</div>
<div class="wrapper">
  <div class="figure star-5"></div>
  <div class="figure star-6"></div>
  <div class="figure star-8"></div>
  <div class="figure star-12"></div>
</div>
<div class="wrapper">
  <div class="figure plus"></div>
</div>
              
            
!

CSS

              
                @use postcss-cssnext;
:root {
  --main-color: rgba(60, 124, 251, .3);
}

body {
  padding: 40px;
}
.wrapper {
  margin-bottom: 40px;
}

.figure {
  position: relative;
  display: inline-block;
  margin-right: 20px;
  border-color: rgba(60, 124, 251, .3);
}
.square {
  width: 100px;
  height: 100px;
  background: var(--main-color);
}
.rectangle {
  width: 150px;
  height: 100px;
  background: var(--main-color);
}
.rectangle {
  width: 150px;
  height: 100px;
  background: var(--main-color);
}
.circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--main-color);
}
.oval {
  width: 150px;
  height: 100px;
  border-radius: 50%;
  background: var(--main-color);
}
.heart {
  width: 60px;
  height: 100px;
  transform: rotate(-45deg);
  border-radius: 30px 30px 0 0;
  background: var(--main-color);
  
  &:before {
    content: '';
    position: absolute;
    width: 60px;
    height: 100px;
    transform-origin: center 70px;
    transform: rotate(90deg);
    border-radius: 30px 30px 0 0;
    background: var(--main-color);
  }
}
.right-triangle {
  border-bottom: 100px solid var(--main-color);
	border-right: 100px solid transparent;
}
.isosceles-triangle {
  border-bottom: 100px solid var(--main-color);
	border-right: 60px solid transparent;
  border-left: 60px solid transparent;
}
.triangle {
  border-bottom: 100px solid var(--main-color);
	border-right: 60px solid transparent;
  border-left: 30px solid transparent;
}
.star-5 {
  top: -40px;
  border-top: 30px solid var(--main-color);
  border-left: 50px solid transparent;
  border-right: 50px solid transparent;
  
  &:before {
    content: '';
    position: absolute;
    top: -23px;
    left: -46px;
    border-bottom: 20px solid var(--main-color);
    border-left: 43px solid transparent;
    border-right: 63px solid transparent;
    transform: rotate(-107.5deg);
  }
  &:after {
    content: '';
    position: absolute;
    top: -23px;
    right: -47px;
    border-bottom: 20px solid var(--main-color);
    border-right: 43px solid transparent;
    border-left: 63px solid transparent;
    transform: rotate(107.5deg);
  }
}
.star-6 {
  border-top: 85px solid var(--main-color);
	border-right: 50px solid transparent;
  border-left: 50px solid transparent;
  
  &:before {
    content: '';
    position: absolute;
    left: -50px;
    bottom: 30px;
    border-bottom: 85px solid var(--main-color);
    border-right: 50px solid transparent;
    border-left: 50px solid transparent;
  }
}
.star-8 {
  top: -30px;
  width: 60px;
  height: 60px;
  background: var(--main-color);
  transform: rotate(-20deg);
  
  &:before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--main-color);
    transform: rotate(-45deg);
  }
}
.star-12 {
  top: -30px;
  width: 60px;
  height: 60px;
  background: var(--main-color);
  transform: rotate(-20deg);
  
  &:before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--main-color);
    transform: rotate(-30deg);
  }
  &:after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: var(--main-color);
    transform: rotate(-60deg);
  }
}
.isosceles-trapezoid {
  width: 50px;
  border-bottom: 100px solid var(--main-color);
	border-left: 25px solid transparent;
	border-right: 25px solid transparent;
}
.rectangular-trapezoid {
  width: 75px;
  border-bottom: 100px solid var(--main-color);
	border-right: 25px solid transparent;
}
.trapezoid {
  width: 100px;
  height: 100px;
  transform: skew(15deg);
  background: var(--main-color);
}
.pentagon {
  width: 50px;
  top: 20px;
  border-width: 50px 20px 0;
  border-style: solid;
  border-color: var(--main-color) transparent;
  
  &:before {
    content: '';
    position: absolute;
    top: -85px;
    left: -20px;
    border-width: 0 45px 35px;
    border-style: solid;
    border-color: var(--main-color) transparent;
  }
}
.hexagon {
  width: 86px;
	height: 50px;
  background: var(--main-color);
  
  &:before {
    content: '';
    position: absolute;
    top: -25px;
    left: 0;
    border-left: 43px solid transparent;
    border-right: 43px solid transparent;
    border-bottom: 25px solid var(--main-color);
  }
  &:after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 0;
    border-left: 43px solid transparent;
    border-right: 43px solid transparent;
    border-top: 25px solid var(--main-color);
  }
}
.heptagon {
  width: 80px;
  top: -13px;
	border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 43px solid var(--main-color);
  
  &:before {
    content: '';
    position: absolute;
    top: -19px;
    left: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 19px solid var(--main-color);
  }
  &:after {
    content: '';
    width: 44px;
    position: absolute;
    bottom: -77px;
    left: -9px;
    border-left: 28px solid transparent;
    border-right: 28px solid transparent;
    border-top: 34px solid var(--main-color);
  }
}
.octagon {
  width: 100px;
  height: 43px;
  top: -5px;
  background: var(--main-color);
  
  &:before {
    content: '';
    width: 44px;
    position: absolute;
    top: -30px;
    left: 0;
    border-left: 28px solid transparent;
    border-right: 28px solid transparent;
    border-bottom: 30px solid var(--main-color);
  }
  &:after {
    content: '';
    width: 44px;
    position: absolute;
    bottom: -30px;
    left: 0;
    border-left: 28px solid transparent;
    border-right: 28px solid transparent;
    border-top: 30px solid var(--main-color);
  }
}
.infinity {
  height: 30px;
  width: 30px;
  left: 60px;
  border: 15px solid var(--main-color);
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
  
  &:before {
    content: '';
    position: absolute;
    top: 30px;
    left: -60px;
    height: 30px;
    width: 30px;
    border: 15px solid var(--main-color);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-180deg);
  }
}
.equilateral-rhombus {
  width: 80px;
  height: 80px;
  background: var(--main-color);
  transform: rotate(45deg);
}
.rhombus {
  border-top: 50px solid var(--main-color);
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  
  &:before {
    content: '';
    position: absolute;
    top: -100px;
    left: -30px;
    border-bottom: 50px solid var(--main-color);
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
  }
}
.pacman {
  border-top: 50px solid var(--main-color);
  border-left: 50px solid var(--main-color);
  border-bottom: 50px solid var(--main-color);
  border-right: 50px solid transparent;
  border-radius: 50%;
}
.plus {
  position: relative;
  width: 20px;
  height: 60px;
  background: var(--main-color);
}
.plus:before {
  content: '';
  position: absolute;
  top: 20px;
  left: -20px;
  width: 60px;
  height: 20px;
  background: var(--main-color);
}
              
            
!

JS

              
                
              
            
!
999px

Console