Pen Settings



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


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


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.


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.


                h1 Centering rotating CSS triangles
    span Problem
    span A solution
  p Hover the triangles to see the box being rotated.
  p.l CSS rotations centre on bounding boxes, so triangles are not rotated on their centroid.
  p.l Using the <code>:after</code> pseudo-element for the triangle, the original element may be given a height and width to create bounding box centred around the triangle's centroid.


                @import compass

$PI: 3.1415926
$rad: 128px
$margin: 32px
$track: 3px
$edge: $rad * sin(2 * $PI / 3) / sin($PI / 6)
$height: $edge * sin(2 * $PI / 3)
$font: 18px
$col: #547
$period: 8s

  background: $col
  font: #{$font} / 1em sans-serif
  color: lighten($col, 40%)
  text-align: center

  font-weight: normal
  font-size: 1.5em

  text-align: left
  line-height: 1.3em

  margin: 2.5em auto
  width: ($rad + $track) * 4 + $margin

  margin-bottom: 1em
  float: left
  width: $rad * 2
  height: $rad * 2
  border: $track dashed lighten($col, 30%)
  border-radius: $rad
    margin-right: $margin
    display: block
    margin: -$font * 1.5 0 $font/2

  height: 0
  width: 0
  border-style: solid
  border-width: 0 $edge/2 $height
  border-color: transparent transparent rgba(255, 255, 255, 0.2)

  -webkit-animation: spin $period linear infinite
  -moz-animation: spin $period linear infinite
  animation: spin $period linear infinite
    background: rgba(0, 0, 0, 0.2)

  margin-left: $rad - $edge/2

  position: relative
  height: $rad * 2
  width: $rad * 2
    content: ""
    position: absolute
    top: 0
    left: $rad - $edge/2

@-webkit-keyframes spin
    -webkit-transform: rotate(360deg)
@-moz-keyframes spin
    -moz-transform: rotate(360deg)
@keyframes spin
    transform: rotate(360deg)